Created
May 5, 2023 23:00
-
-
Save jnicol/299b4e66dd2208892611de34ed07a601 to your computer and use it in GitHub Desktop.
Fix WordPress wp_mail Return Path header, which is used for SPF checks, so that it matches From domain.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Email Return Path Fix | |
Author: Abdussamad Abdurrazzaq | |
Author URI: https://abdussamad.com/archives/567-Fixing-the-WordPress-Email-Return-Path-Header.html | |
*/ | |
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