Moutaz
Moutaz

Reputation: 1

PHP `mail()` problem

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

Thanks

Upvotes: 0

Views: 760

Answers (4)

MoeAmine
MoeAmine

Reputation: 6086

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.

Upvotes: 0

Emil Vikström
Emil Vikström

Reputation: 91983

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]');

Upvotes: 0

Blair McMillan
Blair McMillan

Reputation: 5349

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

Upvotes: 1

Carson Myers
Carson Myers

Reputation: 38564

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.

Upvotes: 0

Related Questions