Mail() problems, yesterday it worked

yesterday this code worked wonderfully but now i dont receive any mails anymore when i wanted to test a new script of mine that needed mail, i did not do any changes in the dreamhost panel so i dont see any reasons for mail() not to work …
i get the output sended but no mail arrived on yahoo or gmail …
$to = ‘’;
$subject = ‘the subject’;
$message = ‘hello’;
$headers = ‘From:’ . “\r\n” .
‘Reply-To:’ . “\r\n” .
‘X-Mailer: PHP/’ . phpversion();

if (mail($to, $subject, $message, $headers)) {
echo “sended”;
echo “wtf error”;
and there are no mail logs …
i tried with this, changed the code a bit still does not work

[php]$to = ‘’;
$subject = ‘the subject’;
$message = ‘hello’;
$headers = “From: MR Alert\r\n”;
$headers .= “MIME-Version: 1.0\r\n”;
$headers .= “X-Mailer: PHP/” . phpversion()."\r\n";

if (mail($to, $subject, $message, $headers)) {
echo “sended”;
echo “error”;

i see no reason for it not to work when i know for sure that it worked yesterday, i am not happy with this

I’m actually having the same issues. (In fact I just registered to these forums to ask this same thing!)

I’m having the same issue with my site. It worked Friday, didn’t work Sunday, didn’t work this morning when I ran tests, but it just started working as of tests ran at 12:43PM est and 12:53PM est.

I’ve submitted a supported ticket that’s about three hours old now. Haven’t received an email confirmation from Dreamhost that I submitted the ticket and haven’t received a response from support at the time of this post.

Emails have been working all morning, though. Not sure what’s up.


Just received a response from support. Apparently their mail relay servers were backlogged. In order to avoid this, send emails using SMTP authentication which will then use their actual SMTP servers.

Looks like you’ll need to include code to use STMP authentication in order to avoid this problem.

As a start, I found this:

does the mail() function work now?

It never stopped working :wink:

If you’d rather step up to SMTP then phpMailer is the duck’s guts.

I’m not sure about “duck’s guts”, but yahoo has sent me a T503 (forever banned) since I started using phpMailer. But actually, that’s prolly just coincidence,… I think it has more to do with the server move to the east coast.

phpMailer will not get anyone permabanned from anywhere.


okay guys, i tried php mailer, i can not make it work at all, readed the documentation on wiki about php mailer and dream host, it did not work like that, i tried to find some examples on the internet on how other have implemented phpmailer to use it with dream host and failed, can any one please give me a working script that works on dream host?
this is what i did until now, it always returns Message could not be sent. why? what is it wrong?
$mail = new PHPMailer();

$mail->IsSMTP();                             // set mailer to use SMTP
$mail->Host = "";  // specify main and backup server
$mail->SMTPAuth = true;     // turn on SMTP authentication
    $mail->Username = "user";        // Make sure to replace this with your shell enabled user
    $mail->Password = "pass";      // Make sure to use the proper password for your user

$mail->From = "me@mydomain";
$mail->FromName = "Your Name";
$mail->AddAddress("", "Their Name");

$mail->AddReplyTo("me@mydomain", "me");
$mail->WordWrap = 50;                                 // set word wrap to 50 characters
$mail->IsHTML(true);                                  // set email format to HTML
$mail->Subject = "PHPmailer example";
$mail->Body    = "This is a test of email";
	echo "Message could not be sent. <p>";
	echo "Mailer Error: " . $mail->ErrorInfo;


SMTP can send emails through two different servers: – login with a mail account username & password
localhost – login with a web server user (ftp/shell) username & password

The combination of “$mail->Host = “”; " and " $mail->Username = “user”; // Make sure to replace this with your shell enabled user” make us think you might be using the wrong user/password for the server you’re trying to use.

The example code you’re using from our PHPMailer wiki page has the “localhost” server, so the comment about “shell enabled user” is fine, but when you replaced that with your actual mail server, you needed to switch to using a username & password that works on the actual mail server, which means a mail account username & password.

Switching away from localhost is fine, but you’ve got to use a mail account username & password with it. :slight_smile:

Also, one of our lovely tech supporters just responded to your submitted ticket! Please reply there directly with the requested details so we can further look into your issue. Thanks!