If you have noticed that your web page or scripts suddenly stopped sending emails or only some were received by others who were not on the same domain... This may be of interest to you. We recently had this issue and called our email host provider and their attitude was basically it's your problem. I am going to tell you one way to solve it.
No you may not have done anything wrong. The host most likely have changed something on their end which affected your account. If you have CPanel on your account this may be an easy fix. If not you will need to find a work-a-round to accomplish the same thing.
First check your MX records to see exactly where they are pointing. You will need to go into CPanel, navigate to the email section, then select Email Routing. If you have more than one domain on the account you will need to set the same setting for each domain on the account (There should be a drop down selector). The selection depends on where your email server is. If your MX record points to your IP then choose
"Local Mail Exchanger", If the MX record points to another server choose
"Remote Mail Exchanger". There should also be a selection for
"Automatic Detect Configuration", if your system is set for this and your mail is not working you may have multiple MX records and it may be confused. If you have multiple MX records, they all must be pointing to the same type of email server, either your local IP or a remote IP.
Basically if your MX record looks something like this.. This is a local email exchanger and uses the cpanel email system. This will resolve to your IP.
MX @ mydomain
Otherwise it may look something like this for a remote email exchanger, you are most likely using WorkSpace Email (GoDaddy). The IP that these resolve to will not be your IP.
MX @ smtp.secureserver.net
MX @ mailstore1.secureserver.net
You must use one system or the other or strange things will happen. This should get your PHP Mail and PHPMailer systems working again.
I have attached two scripts that should work on any account. Just run as is and you should send an email to another email account on the same domain. If you alter the To: address you should be able to send to an email account on a different domain.
WARNING!!!
Usage of these script to send bulk emails will most likely get your account blocked with your ISP
and could get your IP put on a spammers blacklist.