Skip to content

Instantly share code, notes, and snippets.

@athaller
Forked from butlerblog/return_mirror_sender.php
Created August 28, 2019 21:37
Show Gist options
  • Save athaller/e00a259ff67185ab8644c61f15328ada to your computer and use it in GitHub Desktop.
Save athaller/e00a259ff67185ab8644c61f15328ada to your computer and use it in GitHub Desktop.
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment