Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MAIL FUNCTION NOT WORKING

Status
Not open for further replies.

dadms

Technical User
Mar 8, 2003
67
0
0
US
I have built a simple email in PHP that had been working fine for about 6 months. My host has updated PHP to 4.3.11 and it has stopped working. Anybody else had this issue or any suggestions?

Even this simple email script doesnt work.
<?
$to = "xxxxxx@somewhere.net";
$subject = "ZDNet Developer article";
$msg = "I completely understand SMTP servers now!";
$headers = "From: me@mycompany.com\nReply-To: someoneelse@mycompany.com";
$config = "-fwebmaster@mycompany.com";
mail("$to", "$subject", "$msg", "$headers", "$config");
echo "finished!";
?>

 
Just a couple of suggestions:

1. When making a function call catch errors. mail() returns a boolean value that should be inspected, it could be that it returns true now, or false...

2. I always recommend PHPMailer as the best class available for sending e-mail with PHP. See
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top