Page 1 of 1

mail function not sending email?

Posted: Mon Jul 21, 2003 9:49 pm
by nihilist
Hello, Im having trouble getting my script/server to send email.

I used the function on the php.net website, and it is returning that mail is sent, however I have not received a single email in testing this script on any of the emails I have tested with. What is going on?

Code: Select all

<?
function send_mail($myname, $myemail, $contactname, $contactemail, $subject, $message) {
 $headers .= "MIME-Version: 1.0\n";
 $headers .= "Content-type: text/plain; charset=iso-8859-1\n";
 $headers .= "X-Priority: 1\n";
 $headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: php\n";
 $headers .= "From: "".$myname."" <".$myemail.">\n";
return(mail(""".$contactname."" <".$contactemail.">", $subject, $message, $headers));
}
if (send_mail("username", "useremail@isp.com", "Customername", "Customer@customer.com", "This is a test")) {
print "SENT!";
} else {
 print "FAILED!";
}
?>

...

Posted: Mon Jul 21, 2003 10:02 pm
by kettle_drum
Is SMTP up and running on the box your using and is php configured to use it?

Posted: Mon Jul 21, 2003 10:10 pm
by nihilist
Yes it is set up and is set up as localhost in php.

I am not housing it on my server, it is being hosted on a commercial server, so I am assuming they set it up properly.