trecool999 Posted July 8, 2007 Share Posted July 8, 2007 Ok people, here's my problem... I've got a mail script: function Func() { if($_POST['To'] == '' || $_POST['To'] == 'Name@Server.com' || $_POST['Subject'] == '') { die('Not all the required fields are filled in.'); } $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: Chris Kay <raf_dude@hotmail.co.uk>\r\n"; mail('raf_dude@hotmail.co.uk', 'Test', 'Test HTML', $headers); echo 'Yeah'; } If you can already spot what the error is, you're amazing, because I can't. I managed to send an email to myself succesfully when the script was like this: function Func() { if($_POST['To'] == '' || $_POST['To'] == 'Name@Server.com' || $_POST['Subject'] == '') { die('Not all the required fields are filled in.'); } $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: Chris Kay <visitor@gmail-or-other.com>\r\n"; mail('raf_dude@hotmail.co.uk', 'Test', 'Test HTML', $headers); echo 'Yeah'; } But when I changed visitor@gmail-or-other.com to my Email it stops sending the Emails... I've tried to find one mailer on the net that works, because at first I thought my one didn't work because I'd coded it wrong... Turns out even the PEAR mailer won't send it to me either... Anyone have an answer? Quote Link to comment Share on other sites More sharing options...
Wuhtzu Posted July 8, 2007 Share Posted July 8, 2007 May I suggest you do this: $sendmail = mail('raf_dude@hotmail.co.uk', 'Test', 'Test HTML', $headers); if($sendmail) { echo "Mail sent successfully"; } else { echo "Failure... mail not sent"; } It will help determine if the mail() function actually "succeed" or "fails". Quote Link to comment Share on other sites More sharing options...
trecool999 Posted July 8, 2007 Author Share Posted July 8, 2007 May I suggest you do this: $sendmail = mail('raf_dude@hotmail.co.uk', 'Test', 'Test HTML', $headers); if($sendmail) { echo "Mail sent successfully"; } else { echo "Failure... mail not sent"; } It will help determine if the mail() function actually "succeed" or "fails". I already tried that. Apparently it succeeds so I'm now starting to think that it is a problem with Hotmail because when I used it again sending it to my website email, both SquirrelMail and Horde picked it up... Quote Link to comment Share on other sites More sharing options...
trecool999 Posted July 10, 2007 Author Share Posted July 10, 2007 Don't worry, I fixed it somehow. The only problem now is that GMail doesn't work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.