[SOLVED] mail() function not sending email
Posted: Mon Oct 10, 2005 7:03 pm
This is the entire script, with three alternate $header lines as suggested by the hosting company. Nono of them are sending the email.
The hosting support has now stopped responding to me, so I presume they are stumped. Does anyone here have any ideas?
Code: Select all
<?php
$Content = "Date: " . stripslashes($_POST['Date']) . "\n\n";
$Content .= "Email: " . stripslashes($_POST['Email']) . "\n\n";
$Content .= stripslashes($_POST['Msg']) . "\n";
// original, which has worked on a different server at the same hosting company
$MailTo = "me@myemail.com";
$Subject = "Calendar Addition";
$MailFrom = "auto@whatever.org";
mail($MailTo, $Subject, $Content, "From: $MailFrom");
// first suggestion from hosting support -- didn't work
mail($MailTo, $Subject, $Content, "From: $MailFrom", "-f$MailFrom");
// second suggestion from hosting support -- no joy
$headers = "MIME-Version: 1.0\n" ;
$headers .= "From: auto@whatever.org\n";
mail("me@myemail.com", "Calendar Addition", $Content, "$headers");
// not sure why the 4th parameter is in quotes, so I tried
mail("me@myemail.com", "Calendar Addition", $Content, $headers);
// which also did not work
header("Location:calendar.php?Okay=1");
?>