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'] == '[email protected]' || $_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 <[email protected]>\r\n"; mail('[email protected]', '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'] == '[email protected]' || $_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 <[email protected]>\r\n"; mail('[email protected]', 'Test', 'Test HTML', $headers); echo 'Yeah'; } But when I changed [email protected] 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? Link to comment https://forums.phpfreaks.com/topic/58959-solved-using-the-php-mail-function-with-hotmail-accounts/ 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('[email protected]', '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". Link to comment https://forums.phpfreaks.com/topic/58959-solved-using-the-php-mail-function-with-hotmail-accounts/#findComment-292574 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('[email protected]', '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... Link to comment https://forums.phpfreaks.com/topic/58959-solved-using-the-php-mail-function-with-hotmail-accounts/#findComment-292600 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. Link to comment https://forums.phpfreaks.com/topic/58959-solved-using-the-php-mail-function-with-hotmail-accounts/#findComment-294242 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.