Jump to content

Recommended Posts

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 ?

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/167754-mail-function-not-working/
Share on other sites

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);

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.

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.