Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
fixing return-path header in WP
class email_return_path {
function __construct() {
add_action( 'phpmailer_init', array( $this, 'fix' ) );
function fix( $phpmailer ) {
$phpmailer->Sender = $phpmailer->From;
new email_return_path();

This comment has been minimized.

Copy link
Owner Author

@elfacht elfacht commented Dec 27, 2013

WordPress has its own function for sending emails called wp_mail which you can find in wp-includes/pluggable.php. To set the correct return-path header you have to plug into the action “phpmailer_init” that is executed just before an email is sent out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment