cannot send out mails

For some reasons I cannot send out mails using the mail() in php and even trying out any other phpmailer and it only happens with my own domain name but when tyring to send mail to gmail.com it went through.

Btw, to give you more background about the issue, I’ve been using the gmail web email application for my domain mail accounts. I changed the MX record as advised by gmail to point all emails to their server. When using the gmail app for sending and receiving mails for my domain there’s no problem at all BUT when trying out my codes for some website hosted in my domain the mail() didn’t work or any php mailer functions.

Here’s an example: php code running on my website

mail(“myact@mydomain.com”, $sub, $msg, $header);  not working but

mail(“myact@gmail.com”, $sub, $msg, $header); it went through.

I’m getting an error saying myact@mydomain.com is not a valid email account and cannot find that user.

SOLUTION





So I checked the settings on MX record again, I’m using cpanel btw, then I noticed the column ALWAYS ACCEPT for my domain set to YES, so changed it to NO and tried sending mail again AND THIS TIME IT WENT THROUGH.





I remembered when setting up the MX record when trying to point my domain mail accounts to gmail I had this setting Always accept mail locally even if the primary mx does not point to this server. set to yes so remember to SET IT TO NO!

This entry was posted in server and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>