butlerblog
4/10/2015 - 5:09 PM

Set the mail return path to mirror the sender in wp_mail to reduce likelihood of spam rejection

Set the mail return path to mirror the sender in wp_mail to reduce likelihood of spam rejection

add_action( 'phpmailer_init', 'fix_my_email_return_path' );
 
function fix_my_email_return_path( $phpmailer ) {
    $phpmailer->Sender = $phpmailer->From;
}