আমি একটি চালানো ভিপিএস which hosts several domains. Sending mail from these domains has always been tricky. আমি দীর্ঘ ব্যবহার করেছি ডাব্লু SMTP এর 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.
অ ওয়ার্ডপ্রেস সাইটের জন্য কোড
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 টিপ জন্য
আপনার নিজস্ব কিছু চিন্তা পেয়েছেন? নিজেকে মন্তব্য করে নিচের প্রশ্রয় দেয়! আপনি সদস্যতা করতে চান তাহলে উপরের ডানদিকের মেনু এর লিঙ্কে সাবস্ক্রাইব ব্যবহার করুন. এছাড়াও আপনি নীচের সামাজিক লিঙ্ক ব্যবহার করে আপনার বন্ধুদের সাথে ভাগ করতে পারেন. চিয়ার্স.
উত্তর দিন