میں نے ایک رن VPS جو متعدد ڈومینز کی میزبانی کرتا ہے. ان ڈومینز سے میل بھیجنا ہمیشہ مشکل رہا. میں طویل عرصے سے استعمال کیا ہے WP SMTP اس کے ارد گرد کام کرنے کے لئے ورڈپریس کے لئے میل پلگ ان, لیکن میں ایک ٹھیک ٹھیک کرنا چاہتا تھا. بہت پڑھنے کے بعد مجھے ایک مناسب حل ملا
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.
غیر ورڈپریس سائٹس کے لئے کوڈ
1 2 3 4 5 | $message = ‘Your message here’; $sender = ‘you@yourdomain.com’; $headers = ‘From: ’ . $sender . “\r\n” . ‘Reply-To: ’ . $sender . “\r\n” . ‘Return-Path: ’ . $sender; $subject = ‘Your Subject’; $success = mail(‘recepient@mail’, $subject, $message, $headers, “-f ” . $sender); |
نوٹ, کلیدی حصہ حتمی حصہ ہے, 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
ورڈپریس کے لئے
Simply add the following code to your theme’s functions.php or create a custom plugin with the code
1 2 3 4 5 6 7 8 9 10 | class email_return_path { function __construct() { add_action( ‘phpmailer_init’, array( $this, ‘fix’ ) ); } function fix( $phpmailer ) { $phpmailer->Sender = $phpmailer->From; } } new email_return_path(); |
کرنے کے لئے شکریہ Kinamo ٹپ کے لئے
آپ کیا سوچتے ہیں? ہمیں نیچے ایک تبصرہ چھوڑیں! آپ کے سبسکرائب کرنا چاہتے ہیں تو سب سے اوپر دائیں مینو پر لنک سبسکرائب استعمال کریں. آپ بھی ذیل سماجی روابط کا استعمال کرتے ہوئے کی طرف سے اپنے دوستوں کے ساتھ اس کا اشتراک کر سکتے ہیں. چیرس.
جواب چھوڑیں