PHP mail() not sending, but Squirrel mail does?


I have a form email script that uses PHP mail() on my website that allows other members to receive site notifications and allows members to contact other members on behalf of our site.

I am noticing that messages sent to hotmail (and probably other places), are not being received and are not being bounced back.

I set up a Squirrel Mail account managed on Dreamhost and manually sent a message from there, and that message went through to hotmail.

Why is Squirrel mail working, but PHP mail() not working? Squirrel mail is not an option for automated notifications on my site from other members.

Here is my PHP mail() script:
[php]$messages = wordwrap($_POST[‘message’], 70);
$subject = $_POST[‘subject’];
$receiver = $_POST[‘receiver’];
$to = $receiver;
$headers = “From: My Company\r\n”;
$headers = “Reply-To:”;
$sentmail = mail($to,$subject,$messages,$headers,"");[/php]

Is there something I need to add to this script to get it working right?


EDIT: I’ve also tried PHPMailer and that still doesn’t seem to work for getting messages to hotmail.

Ok, I found a way to send the email to hotmail using PHPMailer by using my mailbox login instead of the SFTP login.

My test email is at least making it into the junkbox folder over at hotmail. It’s still not making it to the inbox folder like Squirrel mail was able to do. I’m going to keep working on it. Hopefully someone can chime in with a few tips on getting my messages sent just like they did when I manually sent it with Squirrel mail and everything worked fine.

I think you need to use SMTP to send mail via PHP on Dreamhost, you might want to take a look at this page.

Yes, I believe this is what is being used with PHPMailer, what I’m using now:

I am now using the same SMTP login info that I am using for Squirrel mail. Last problem now is PHPMailer is always sending mail to the Junkbox, whereas Squirrel mail is always sending it to the Inbox (which is where I’d like it to go). I have no clue why this is happening.
Ah nevermind, seems like for no reason at all, PHPMailer is starting to go into the Inbox rather than junkbox. Strange, not sure why.

Looks like the mail is being sent just fine now. I’ll have to use PHPMailer from now on I guess.

Thanks for looking
Kind regards