Bruce Gust
asked on
What's wrong with this email script?
This code works fine on my server, but when I take it over to my client's server, while there are no errors, no email is delivered. What am I missing?
<?php
$from_email="bruce@brucegu st.com";
$to = "bruce@brucegust.com";
$subject = "test";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;ch arset=iso- 8859-1" . "\r\n";
$headers .= "From:";
$headers .= $from_email;
$headers .= "\r\n";
$message = "awesome";
mail($to, $subject , $message, $headers);
echo "done";
?>
<?php
$from_email="bruce@brucegu
$to = "bruce@brucegust.com";
$subject = "test";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;ch
$headers .= "From:";
$headers .= $from_email;
$headers .= "\r\n";
$message = "awesome";
mail($to, $subject , $message, $headers);
echo "done";
?>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"phpinfo()" will tell you what is set for your SMTP connection. Save this and run it on that server to see what it says. What kind of web server is it? Apache? IIS? nginx? And what hosting company?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>PHP Check</title>
</head>
<body>
<p>PHP Check</p>
<?php phpinfo() ?>
<?php phpversion() ?>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
As it turned out, the server wasn't set up to deliver email. Once I was able to determine that conclusively, thanks to your input, we got it taken care of.
ASKER