jiggens Posted July 28, 2009 Share Posted July 28, 2009 I have tried pretty much everything to get my php mail to work. I have set my php.ini file to my local ip address, localhost, public ip address, internal dns name, MX record. No matter what i put in there i am no able to send my email. I am using windows IIS6 with smtp service installed. SMTP works fine and will send outside and inside e-mail addresses. I tried doing a simple php mail script and it fails every time. What am i missing ? phpinfo file is correct and has the local ip address of the smtp server which is the same server. Do i need to edit permissions or anything ? Quote Link to comment https://forums.phpfreaks.com/topic/167754-mail-function-not-working/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 28, 2009 Share Posted July 28, 2009 Your mail server is probably set up to NOT accept email for relaying from a php script using just the mail() function. To start with, see what if any error messages are returned by adding the following two lines of code immediately after your first opening <?php tag - ini_set("display_errors", "1"); error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/167754-mail-function-not-working/#findComment-884642 Share on other sites More sharing options...
jiggens Posted July 28, 2009 Author Share Posted July 28, 2009 Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for name@domain.com in C:\Inetpub\wwwroot\output\mail.php on line 10 Message delivery failed.... Quote Link to comment https://forums.phpfreaks.com/topic/167754-mail-function-not-working/#findComment-884643 Share on other sites More sharing options...
PFMaBiSmAd Posted July 28, 2009 Share Posted July 28, 2009 You have two choices - 1) Configure your mail server to "trust" the IP address of your web server/php and relay email from it, or 2) Use SMTP authentication. This involves making php look like an email client (like Outlook) using authentication. Unfortunately the php mail() function does not support SMTP authentication and you need to use one of the php mailer classes to do this. Quote Link to comment https://forums.phpfreaks.com/topic/167754-mail-function-not-working/#findComment-884648 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.