Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Exchange server Relay Error -SMTP server response: 501 5.5.4

Status
Not open for further replies.

clank

Technical User
Nov 13, 2002
11
GB
I'm trying to use SMTP on Exchange server 2003 within a network on XP SP2 machine to send email (from a PHP/apache setup) locally but keep getting relay errors. I tried telnet from the machine and that works fine.

I have granted relay permissions to the machine on exchange server. SMTP service running on XP machine.

Any ideas what I'm doing wrong?

PHP Script:
<?
$to = "email1@x.local";
$from = "email2@x.local";
$sub = "My Email";
$msg = "Hello World!";
mail($to, $sub, $msg, "From: ".$from);
?>

Error:
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for
email2@x.local in C:\Program Files\Apache Group\Apache2\htdocs\mail2.php on line 6

php.ini settings:
PHP.ini settings
[mail function]
; For Win32 only.
SMTP = 10.0.0.250
smtp_port = 25

; For Win32 only.
sendmail_from = email2@x.local
 
Okay - the easy stuff first:

x.local is a domain that appears in a recipient policy in Exchange, correct? Why not use your .com/.net/.org address?
email1@x.local and email2@x.local are email addresses that are assigned to users, correct?

Pat Richard, MCSE(2) MCSA:Messaging, CNA(2)
 
@58sniper
1. Yes, x.local appears in recipient policy. I also tried allowing all but didn't work.

2. Why not use .com/.net/.org? I tried no luck. Additionally all the .com emails are routed via a email security management hence using .local for simplicity.

3.email1@x.local and email2@x.local are email addresses assigned to users.

Thanks
 
Sorted.

I was opening relay on the server instead of the local machine.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top