Using php mail function with Exchange 2010

the mail() function

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Fri Jun 03, 2011 11:12 am

Using php mail function with Exchange 2010

Postby lukeh1980 » Fri Jun 03, 2011 11:24 am


I have been using a php mail script to send our monthly newsletter out and we have recently switched to using Exchange 2010 for our mail server. When I send email with the php script Exchange will only relay to internal email addresses, I get SMTP server response: 550 5.7.1 Unable to relay on addresses that are outside our domain.

My php.ini settings are:

[mail function]
SMTP = <server ip>
smtp_port = 25
sendmail_from = <email address>

(I have also tried adding the username and password for the email account to the above)

I understand that this is probably an Exchange configuration problem but would like to know if anyone else has had trouble using exchange servers with the php mail function. From our settings "anonymous users" is allowed, and it appears that it should relay but it doesn't.

Any help or direction would be greatly appreciated, this worked fine on our old mail server (kerio).


User avatar
php-forum Fan User
php-forum Fan User
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: Using php mail function with Exchange 2010

Postby Nullsig » Fri Jun 03, 2011 11:27 am

its a problem with the configuration in the Exchange server not the script. Check out this page, it should help.

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 4 guests