Function added to hook “new_to_publish” not executing – custom plugin

You need to add parameters $old_status and $new_status to the function.

  function conditional_email( $old_status, $new_status) {
   wp_mail('[email protected]','test','test');
  }

You will see that in the example here

Hope it works after !

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)