freshfreelovinit Posted February 22, 2007 Share Posted February 22, 2007 Hi I was having a problem with a free subscription not working on my website so I tried to narrow down the problem and ended up with these two lines of php code: mail("[email protected]", "testing", "testing www.escapesmoking.com", "$headers"); mail("[email protected]", "testing", "testing", "$headers"); I do not receive mail from the first mail command but I do receive mail from the second mail command. My webhost says it is my problem to fix but i don't see how I can fix it. It seems that mail I send out which contains my website address does not get through. Does anyone have any advice they can give me? Thanks Alessandra Quote Link to comment https://forums.phpfreaks.com/topic/39699-simple-mail-command/ Share on other sites More sharing options...
magic2goodil Posted February 22, 2007 Share Posted February 22, 2007 did you check your junk mail? Sometimes mail servers like hotmail, yahoo, etc.. read mail as spam if it has a web address in the subject line like that. Try adding the subject line in the headers as well and play around with it. I have a mail code that gets through to any mail server and past spam but it took some work and playing around. Quote Link to comment https://forums.phpfreaks.com/topic/39699-simple-mail-command/#findComment-191650 Share on other sites More sharing options...
Ninjakreborn Posted February 22, 2007 Share Posted February 22, 2007 Try this mail("[email protected]", "testing", "testing www.escapesmoking.com", $headers); mail("[email protected]", "testing", "testing", $headers); and make sure the headers variable has something in it. Quote Link to comment https://forums.phpfreaks.com/topic/39699-simple-mail-command/#findComment-191705 Share on other sites More sharing options...
freshfreelovinit Posted February 23, 2007 Author Share Posted February 23, 2007 Hi The web address is in the body of the mail, not the subject, and it is not going to my bulk mail. The headers do contain information and all the information is syntactically correct. Alessandra Quote Link to comment https://forums.phpfreaks.com/topic/39699-simple-mail-command/#findComment-191816 Share on other sites More sharing options...
Ninjakreborn Posted February 23, 2007 Share Posted February 23, 2007 Then it's something definitely related to your webhost. Try if (mail(stuffhere)) { echo "Mail sent"; }else { echo "Mail not sent. } Quote Link to comment https://forums.phpfreaks.com/topic/39699-simple-mail-command/#findComment-192114 Share on other sites More sharing options...
freshfreelovinit Posted February 27, 2007 Author Share Posted February 27, 2007 Hi Thanks for the suggestion of obtaining the return status of the mail command which did actually return a success status when I ran it. I have passed this information on to the webhost. Alessandra Quote Link to comment https://forums.phpfreaks.com/topic/39699-simple-mail-command/#findComment-194987 Share on other sites More sharing options...
Archadian Posted February 27, 2007 Share Posted February 27, 2007 make sure your ISP does NOT have port 25 blocked (SMTP) Quote Link to comment https://forums.phpfreaks.com/topic/39699-simple-mail-command/#findComment-194990 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.