PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?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");
?>
The hosting support has now stopped responding to me, so I presume they are stumped. Does anyone here have any ideas?
Last edited by Bill H on Tue Oct 11, 2005 9:56 am, edited 1 time in total.
Tried "\n\n" on the end of $header and "\r\n" both. Mail is definitely not getting dumped into junk mail bin, I check for receipt using a webmail client that does not have any such critter.
I think it is a server setting, personally, and my host is laying low. I host five sites with this company and all are one of two servers that I like while this one got put on a different server that I have no experience with. I have a feeling I need to harass them some more, but I wanted you guys to check to be sure I'm not missing something in the code.
Not now, tho. It's almost time for the Chargers to take on the Steelers on MONDAY NIGHT FOOTBALL.
Hmm... if it was configuration issue you would probably see errors. Is it a linux server? If it is then it should probably just work by sendmail. Windows servers I suppose could have incorrect SMTP settings though. The only other thing I can think of is that the server has the SMTP port closed by a firewall mistakenly