Related, possible duplicate: PHP mail stopped working
Hello;
I have a site hosted on GoDaddy, that processes several news web sites and emails a summary of articles. It has been working fine, until two days ago when I stopped receiving emails. mail()
returns true, and when sending basic text emails I receive them, only HTML I can't receive! Any idea about the cause or how to troubleshoot this issue?
Thanks
Update: This is the code I use (PHP):
$headers = 'From: Aggregator Daemon' . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=windows-1252' . "\r\n";
开发者_如何学编程$mailres=mail("dummy@nowhere.com","GN Aggregator - $today Bulletin",$ebody,$headers);
Thanks
I always recommend, use something like SwiftMailer when dealing with sending emails. It handles all of the headers etc quite nicely.
My first thought is that there is something wonky in the headers, particularly the content-type or the encoding.
That being said, something could have changed on the GoDaddy server or one of the MTA's which is causing your email to be rejected for some reason.
There's not really a way to tell without seeing some code.
Also, read this question for more information.
Try setting a Return-Path header so you receive bounced e-mails. This can not be set in the "additional headers" parameter, but in the "additional parameters" parameter to the mail function. On a Linux hosting account you do like this:
mail($to, $subject, $ebody, $headers, '-f bounceaddress@example.com');
I would recommend using PHP Mailer. I use it in my scripts it's easy in implementing and it works properly. It's also used by WordPress.
精彩评论