zims15 Posted January 29, 2008 Share Posted January 29, 2008 Hi there, I have a web host with an associated domain name (mydomain.com). The A record for the domain name points to the web host. The MX record for the same domain name points to a different server, as the mail is hosted elsewhere. On the web server, I have a PHP script that uses the mail() function to send email. The recipient address in the script uses the same domain name as above (user@mydomain.com). However, when the mail() function is executed, the MX record of the domain name is ignored, and the SMTP agent on the web server attempts to deliver the email to its own local mailbox, which doesn't exist. As soon as I change the recipient address to an external domain, everything works as it should. The strange thing is, the mail() call does not seem to return anything; the entire script just stops there, without any warnings or errors of any kind (regardless of the reporting level). The following produces no output: if (mail($email_to, $email_subject, $email_message, $email_headers) === TRUE) { print("success"); } else { print("failure"); } Any help is appreciated! -- zims Quote Link to comment https://forums.phpfreaks.com/topic/88433-mail-sendmail-local-domain-issue/ Share on other sites More sharing options...
budimir Posted January 29, 2008 Share Posted January 29, 2008 Did you check that your mail() setting is enabled in the .ini settings. Try to test the mail function and see what is happening. If it's working try to check your host:........ which you are using. You have already finished send_mail.php scripts on the web. Quote Link to comment https://forums.phpfreaks.com/topic/88433-mail-sendmail-local-domain-issue/#findComment-452584 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.