Last active
January 30, 2024 15:26
-
-
Save schorschii/51c966a0eb035048427fe674abc5c84a to your computer and use it in GitHub Desktop.
Simple WordPress plugin to set the "envelope sender" correctly, so that e.g. Gmail accepts them. Just create a folder "wp-content/plugins/fix-mail-sender" and put this file there. Don't forget to activate the plugin and enjoy. Note: if you are on Hetzner, you need to create a mailbox "[email protected]" too to make it work. Don't ask why.
This file contains 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: Fix Mail Sender | |
* Plugin URI: https://georg-sieber.de | |
* Description: Sets the envelope sender correctly to the "From" header address to enable mail delivery to Gmail from managed webservers. | |
* Version: 1.0 | |
* Author: Georg Sieber | |
* Author URI: https://georg-sieber.de | |
* License: free | |
*/ | |
function fixEnvelopeSender($phpmailer) { | |
$phpmailer->Sender = $phpmailer->From; | |
} | |
add_action( 'phpmailer_init', 'fixEnvelopeSender' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment