• Hello,

    I’ve setup WP-Email and tried to use it with Sendmail. However I looked inside the code and the $mail->Sender is never set.

    Could it been added in the options screen please? It would help to add the flag “-f” to mail/sendmail without hacking the code ??

    Thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter thom4

    (@oncletom)

    I hacked a bit the plugin to make this work as I wanted to:

    apply_filters('wp_email_send_pre', $mail, $post);
    
    // Send The Mail if($mail->Send()) {
    if($mail->Send()) {

    I added a filter before sending so I can deal how I want.
    Then I’ve plugged my hook on it:

    add_filter('wp_email_send_pre', 'wp_email_authsmtp_fix', 10, 2);
    function wp_email_authsmtp_fix($mail, $post)
    {
      $email_smtp = get_option('email_smtp');
    
      foreach (array('yourname', 'youremail') as $arg)
      {
        $$arg = isset($_POST[$arg]) ? strip_tags(stripslashes(trim($_POST[$arg]))) : '';
      }
    
      $mail->AddReplyTo($youremail, $yourname);
      $mail->Sender = $mail->From = $email_smtp['username'];
    
      return $mail;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WP-EMail] Specify custom Sender with Sendmail method’ is closed to new replies.