Skip to content

Instantly share code, notes, and snippets.

@Dantali0n
Created December 10, 2018 10:18
Show Gist options
  • Save Dantali0n/37b9e935bdc87abd480a136c090cc345 to your computer and use it in GitHub Desktop.
Save Dantali0n/37b9e935bdc87abd480a136c090cc345 to your computer and use it in GitHub Desktop.
Fix Wordpress emails disappearing due to incorrect return-path set from phpmailer
<?php
/*
Plugin Name: Email Return Path Fix
Author: Abdussamad Abdurrazzaq
*/
class email_return_path {
function __construct() {
add_action( 'phpmailer_init', array( $this, 'fix' ) );
}
function fix( $phpmailer ) {
$phpmailer->Sender = $phpmailer->From;
}
}
new email_return_path();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment