kathymack Posted September 17, 2014 Share Posted September 17, 2014 Hi I wrote some basic custom php code that presents a form to a user, they submit their details and an email gets sent to me. I checked and the fields from the form are being carried over. Up to about a week ago it was working and now it has stopped working and I have no idea why. I have checked with my isp and no changes were made to anything php version is 5.2 php-ini.txt contact-process.php Quote Link to comment https://forums.phpfreaks.com/topic/291135-php-mail-function-stopped-working/ Share on other sites More sharing options...
mac_gyver Posted September 17, 2014 Share Posted September 17, 2014 the receiving mail server @gmail.com probably blacklisted the sending mail server at your web host. the email is NOT being sent by or From: the email address that is being input in your form. the email is being sent from the mail server at your web host. the From: address in the email, at a minimum, needs to be a real mail box at your sending mail server. in addition to just helping to insure that an email will be processed, the From: email address is used as the return-path for bounce/error messages back from the receiving mail server when you haven't specifically supplied a Return-path email address in the mail headers. the email addressed entered in your form should be put into a Reply-to: mail header. what likely happens in these cases, is that enough people have entered xxxxx@gmail.com addresses in your form, which your code then used as the From: email address, and since gmail knows the sending mail server at your web host isn't a gmail mail server, all those emails saying they were From; xxxxx@gmail.com addresses eventually get your sending mail server blacklisted. another possibility, is that the receiving mail server received a 'flood' of emails from your sending mail server in a short time and blacklisted it. edit: another possibility, since you are NOT validating the user submitted data that you are currently putting into the mail header, which allows spammers to set any thing in the email message to anything they want, it that your script is being used to send huge volumes of spam, and has been blacklisted by numerous receiving isp's. in addition to fixing the mail headers, you will need to track down if your sending mail server is actually sending the email or if the receiving mail serve is discarding them them. after you can determine that your sending mail server is actually sending the emails, you can contact the 'postmaster' at @gmail.com to try and find out if/why they may be discarding emails you sending mail server has sent to their mail servers. an alternative that would allow you to send emails directly to your @gmail.com mail box, would be to use one of the php mailer classes and use smtp authentication against your mail box (you would use your email name and password in the script.) this would allow your php script to send the email directly to your mail box, without going through the mail server at your web host. Quote Link to comment https://forums.phpfreaks.com/topic/291135-php-mail-function-stopped-working/#findComment-1491455 Share on other sites More sharing options...
Rifts Posted September 18, 2014 Share Posted September 18, 2014 I had a problem like this also. I figured out the problem was my hosting. I was using a shared godaddy plan and after sending a few test emails to myself suddenly I wasn't able to send anymore emails. This is because of GODADDY. You need a better server. Quote Link to comment https://forums.phpfreaks.com/topic/291135-php-mail-function-stopped-working/#findComment-1491516 Share on other sites More sharing options...
jazzman1 Posted September 18, 2014 Share Posted September 18, 2014 There is a limit up to 1000 emails per day (24h) for the shared hosting plan. Not sure how they calculate them, but more than 3 years I've been able to send around 3000 mails per day to my members Quote Link to comment https://forums.phpfreaks.com/topic/291135-php-mail-function-stopped-working/#findComment-1491530 Share on other sites More sharing options...
blmg2009 Posted September 18, 2014 Share Posted September 18, 2014 Are you send from an email hosted on your account with your hosting service? Quote Link to comment https://forums.phpfreaks.com/topic/291135-php-mail-function-stopped-working/#findComment-1491533 Share on other sites More sharing options...
jazzman1 Posted September 18, 2014 Share Posted September 18, 2014 Are you send from an email hosted on your account with your hosting service? Yes. In the beginning the mail-script was written in bash lately i switched it to swiftmailer / php. The messages are chunk-ed at small portions and using a cron job sending them in 1 hour. This way prevents emails flooding. Quote Link to comment https://forums.phpfreaks.com/topic/291135-php-mail-function-stopped-working/#findComment-1491540 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.