Derleek Posted July 30, 2008 Share Posted July 30, 2008 So i can't figure out why this isn't working... <?php $to = "[email protected]"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; if (mail($to, $subject, $body)) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?> Now, i had this working several days ago and it mysteriously stopped... i don't know what it could be. any idea's? Link to comment https://forums.phpfreaks.com/topic/117437-mailing-function-not-working/ Share on other sites More sharing options...
EPCtech Posted July 30, 2008 Share Posted July 30, 2008 Hiya, I'm just guessing, but maybe try this: <?php $to = "[email protected]"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $mai=main($to,$subject,$body); if ($mai) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?> I don't expect it to work, but it might. Best Regards, En-Psyche Management Link to comment https://forums.phpfreaks.com/topic/117437-mailing-function-not-working/#findComment-604059 Share on other sites More sharing options...
ShaunO Posted July 30, 2008 Share Posted July 30, 2008 What do you mean by 'mysteriously stopped'? What is happening that makes you think this is no longer working? Error messages? Link to comment https://forums.phpfreaks.com/topic/117437-mailing-function-not-working/#findComment-604060 Share on other sites More sharing options...
Derleek Posted July 31, 2008 Author Share Posted July 31, 2008 no, i'm simply not receiving the test e-mail any longer... and did you mean to change it to 'main($to... etc)' Link to comment https://forums.phpfreaks.com/topic/117437-mailing-function-not-working/#findComment-604104 Share on other sites More sharing options...
EPCtech Posted July 31, 2008 Share Posted July 31, 2008 <?php $to = "[email protected]"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $mai=mail($to,$subject,$body); if ($mai) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?> Forgot to put "mail" instead of "main". Ha ha. Best Regards, En-Psyche Management Link to comment https://forums.phpfreaks.com/topic/117437-mailing-function-not-working/#findComment-604721 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.