Title: [Plugin: WP-EMail] Specify custom Sender with Sendmail method
Last modified: August 19, 2016

---

# [Plugin: WP-EMail] Specify custom Sender with Sendmail method

 *  [thom4](https://wordpress.org/support/users/oncletom/)
 * (@oncletom)
 * [17 years ago](https://wordpress.org/support/topic/plugin-wp-email-specify-custom-sender-with-sendmail-method/)
 * 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](https://wordpress.org/support/users/oncletom/)
 * (@oncletom)
 * [17 years ago](https://wordpress.org/support/topic/plugin-wp-email-specify-custom-sender-with-sendmail-method/#post-1085788)
 * 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.

## Tags

 * [sendmail](https://wordpress.org/support/topic-tag/sendmail/)

 * 1 reply
 * 1 participant
 * Last reply from: [thom4](https://wordpress.org/support/users/oncletom/)
 * Last activity: [17 years ago](https://wordpress.org/support/topic/plugin-wp-email-specify-custom-sender-with-sendmail-method/#post-1085788)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
