tags:

views:

193

answers:

5

Related, possible duplicate: http://stackoverflow.com/questions/1892409/php-mail-problem

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("[email protected]","GN Aggregator - $today Bulletin",$ebody,$headers);

Thanks

A: 

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.

Carson Myers
+1  A: 

I always recommend, use something like SwiftMailer when dealing with sending emails. It handles all of the headers etc quite nicely.

Blair McMillan
A: 

Make sure you’re specifying an email address in the From: header, like so:

$headers = 'From: Aggregator Daemon <[email protected]>' . "\r\n";

Does that help?

If not, what kind of email account are you using to test this? Gmail?

Also, why are you using the windows-1252 charset?! Just use UTF-8. (This is unrelated to your problem, though.)

Mathias Bynens
I have tried Gmail, and my mailbox hosted by GoDaddy as well, same result.
Moutaz
Have you tried updating the `From:` header?
Mathias Bynens
A: 

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 [email protected]');
Emil Vikström
A: 

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.

amindzx