Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/291135-php-mail-function-stopped-working/
Share on other sites

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.

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.