Page 1 of 1

Mail() function not working...

Posted: Wed Jul 07, 2010 9:02 pm
by Limits
Hey guys, I'm currently writing a script that requires the mail() function and it's not working for me... I isolated my mail() code and it's still not working. Here's the code:

Code: Select all

<?php 

$subject = 'hello!';
$to = 'my@email.com';
$content = 'Hello World!';
$from = 'From: hello@test.com';

if(mail($to, $subject, $content, $from)) {
	echo "Success!";
} else {
	echo "failure";
}

?>
I've tried it both with and without the $from included in the additional headers param.
The page is always displaying "success" but there is no new mail in my inbox :/

Any ideas?
Thanks guys!

Re: Mail() function not working...

Posted: Wed Jul 07, 2010 10:16 pm
by requinix
Have you looked in your spam folder? Have you tried different email addresses? Have you checked the server for any mailing errors? Have you made sure that your sendmail daemon or equivalent is running and that its mail queue is empty?

Re: Mail() function not working...

Posted: Wed Jul 07, 2010 10:47 pm
by Limits
Thanks man, it's not the email addresses, so it must be a server/sendmail issue. I'll double check everything. Thanks! :D