megetron Posted December 24, 2011 Share Posted December 24, 2011 hello, I host my website on a linux server, but when I click this code: mail($to,$sub,$body1, $headers); it does not send any mail. I dont get any error also. I know that it worked on other servers. what should I do? thanks Quote Link to comment https://forums.phpfreaks.com/topic/253793-mailtosubbody1-headers-doesnt-work/ Share on other sites More sharing options...
AGuyWithAthing Posted December 24, 2011 Share Posted December 24, 2011 Usually if the mail function has worked it's an issue with your MTA (most likely sendmail, postfix or exim) If so check your /var/log/mail.log, exim log, postfix log etc and see what the MTA is doing with the email. In your shell run the following command if using sendmail : tail -f /var/log/mail.log Then run your script and usually you will see the email appear in that and give an error if it fails. Quote Link to comment https://forums.phpfreaks.com/topic/253793-mailtosubbody1-headers-doesnt-work/#findComment-1301167 Share on other sites More sharing options...
ocpaul20 Posted December 26, 2011 Share Posted December 26, 2011 In the past when I have had issues with hosted websites, it has sometimes been the 'from' email address has to come from an address on your domain. Just a possible reason why it is disappearing. There is usually a forum on hosted websites which have lots of email problems (with solutions) so it may be a good idea to check these out too. Quote Link to comment https://forums.phpfreaks.com/topic/253793-mailtosubbody1-headers-doesnt-work/#findComment-1301302 Share on other sites More sharing options...
peter_anderson Posted December 26, 2011 Share Posted December 26, 2011 What are you setting each of the variables to? Quote Link to comment https://forums.phpfreaks.com/topic/253793-mailtosubbody1-headers-doesnt-work/#findComment-1301421 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.