TLawrence Posted September 3, 2008 Share Posted September 3, 2008 I'm currently working on a project that sends emails to users via the mail() function in PHP. It works fine when I'm sending an email to a user within the client's domain (I'll use client.com as an example). So tester1@client.com, tester2@client.com, etc., are delivered with no problems. If I try to send an email to another domain, say tester@external.com, I get the "550 5.7.1 Unable to relay for tester@external.com" error message. I'm assuming this is a security feature of Exchange to keep the server from being a spam relay. Is there some way I can turn this off, or allow these "external" emails to be sent? Some of the users on this system do not have an internal email address, so I need to be able to send emails to any address. I don't think it's a PHP problem since the internal addresses are working. Is there some setting on the Exchange server I can change that will allow emails to be sent to any address? Any help would be appreciated. Thanks in advance, tlawrence Quote Link to comment Share on other sites More sharing options...
discomatt Posted September 3, 2008 Share Posted September 3, 2008 http://www.google.ca/search?q=550+5.7.1+Unable+to+relay http://www.chilkatsoft.com/faq/Smtp550.html Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 3, 2008 Share Posted September 3, 2008 What are you putting into the From: address in each case (working and non-working)? Quote Link to comment Share on other sites More sharing options...
TLawrence Posted September 4, 2008 Author Share Posted September 4, 2008 The From address is a working, internal email address. I found these steps on another website...this MAY solve the problem. I'm waiting for my client to try it. Open the Exchange System Manager; Go in Administrative Groups -> Administrative group name -> Server -> Server name -> Protocols -> SMTP; Right click on Default SMTP Virtual Server -> properties; Access tab -> Relay buttom; Select "only the list bellow" and add your domain and\or IPs you do want to allow the relay and finally check the "Allow all computers witch successfully authenticate to relay, regardless of the list above" checkbox. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 4, 2008 Share Posted September 4, 2008 The reason I asked about the From: address is that the mail server should have already been setup to allow relaying when the From: address is a valid email address hosted on the mail server (many people put other things/external addresses into the From: address and then have the same symptoms that you are having.) Quote Link to comment Share on other sites More sharing options...
TLawrence Posted September 4, 2008 Author Share Posted September 4, 2008 Right, I've run into that before which some times works, and some times doesn't, but that's another issue. The problem is that I'm not familiar with Exchange so I have to rely on my client's IT department. But they don't seem to know a whole lot about the ins and outs of Exchange either, so I was looking for someone to shed further light on the situation. I need the server to relay mail to any email address via the mail() function. Isn't there some kind of setting in Exchange to allow this? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 4, 2008 Share Posted September 4, 2008 What you posted above is correct. That will add the web server/php to the list of trusted domains/ip address that Exchange will relay email for. Quote Link to comment Share on other sites More sharing options...
TLawrence Posted September 4, 2008 Author Share Posted September 4, 2008 The only problem with this is that I won't always know the domain. The users enter their own email address, which could be anything, so I don't know what domains/IPs to allow. Is there a way to configure Exchange to allow relaying for any email address? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 4, 2008 Share Posted September 4, 2008 The domain/ip is that of the web server where the php script is executing. Quote Link to comment Share on other sites More sharing options...
TLawrence Posted September 4, 2008 Author Share Posted September 4, 2008 I don't see how adding the server's IP would change the outcome. I can already send emails to internal addresses, just not external, so it has do with domain of the email address, not the server....now that I think about it, I don't think that solution below is going to work. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 4, 2008 Share Posted September 4, 2008 When the To: address is on the server, the email just an incoming email. No relaying is involved and no relaying rules are applied. When the To: address is not on the server, the relaying settings come into play and the client sending the email (php) must either be trusted by the mail server or you must use SMTP authentication, which is what the last part of the post you made above is mentioning. Sending To: the email server is different than relaying through the email server. Quote Link to comment Share on other sites More sharing options...
TLawrence Posted September 4, 2008 Author Share Posted September 4, 2008 Gotcha....I appreciate the information and explanation. I just heard back from my client....the fix below seemed to work...problem solved!! Woohoo!!! Quote Link to comment 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.