Skip to content

Instantly share code, notes, and snippets.

@butlerblog
Last active November 22, 2021 22:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save butlerblog/48ea5637c81053ef7375 to your computer and use it in GitHub Desktop.
Save butlerblog/48ea5637c81053ef7375 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