मैं एक चलाने वीपीएस which hosts several domains. Sending mail from these domains has always been tricky. मैं लंबे समय से उपयोग किया है WP एसएमटीपी Mail plugin for wordpress to work around this, but I wanted to get a proper fix. After much reading I found a proper solution
The problem is that the “from” address and the “return to” address have to match and unless you know how to fully do the code they wont.
गैर वर्डप्रेस साइटों के लिए कोड
$संदेश = 'आपका संदेश यहाँ'; $इस = 'you@yourdomain.com'; $हेडर = 'से: ' . $प्रेषक . "\r n" . 'को उत्तर: ' . $प्रेषक . "\r n" . 'वापसी का पथ: ' . $प्रेषक; $विषय = 'आपका विषय'; $सफलता = मेल('Recepient @ मेल', $विषय, $संदेश, $हेडर, "-च " . $प्रेषक);
नोट, महत्वपूर्ण हिस्सा अंतिम भाग है, the extra value AFTER the headers. This is the extra parameters part and we specify the sender again with a ‑f command
For more info on this there is a good article at Pupunzi
WordPress के लिए
Simply add the following code to your theme’s functions.php or create a custom plugin with the code
वर्ग email_return_path { समारोह __construct() { ADD_ACTION( 'Phpmailer_init', सरणी( $यह, 'ठीक कर' ) ); } समारोह ठीक( $PHPMailer ) { $phpmailer->Sender = $phpmailer->From; } } नई email_return_path();
करने के लिए धन्यवाद Kinamo टिप के लिए
“Hi James I realise it has been a long while, but I just checked this on windows 11 (build 23H2)…”