Solved

Database Mail

Posted on 2010-09-10
21
652 Views
Last Modified: 2012-05-10
I'm trying to send mail from sql server 2008 using database mail. When i send a test mail i can recieve it to my company email. But when I send to a hotmail account or any other external email account i get the message:

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2010-09-10T19:16:50). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Unable to relay).

Any help would be greatly appreciated.
0
Comment
Question by:rbasilides
  • 10
  • 10
21 Comments
 
LVL 2

Expert Comment

by:Josh Thomas
ID: 33651298
http://www.sqlnewsgroups.net/group/microsoft.public.sqlserver.server/topic23749.aspx

According to this, you can't use an external email account, it needs to be SMTP (which would be Exchange or whatever SMTP server you're using)
0
 
LVL 49

Expert Comment

by:Akhater
ID: 33651300
yes this is normal because you need to allow relaying for your SQL on your exchange server

please check this article to accomplish
http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/A_2666-Allow-relaying-on-Exchange-2007-Exchange-2010-in-4-easy-steps.html
0
 

Author Comment

by:rbasilides
ID: 33661623
I've created the recieve connector and set up the approriate options but I'm still getting the "5.7.1 Unable to realy" error. After I've created the recieve connector I made sure to reset the Transport service and do an Edge sync but still does not work.
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 49

Expert Comment

by:Akhater
ID: 33662249
did you add an addtional IP to your exchange server and set this receive connector to listen only to that IP ?
0
 

Author Comment

by:rbasilides
ID: 33663400
Would I need to create an open relay in the Accepted Domains? It works when I do set that up.
0
 
LVL 49

Expert Comment

by:Akhater
ID: 33663431
no

did you follow my article ?

1. did you add ip address to the server ?
2. did you configure an extra receive connector to listen to this ip ?
0
 

Author Comment

by:rbasilides
ID: 33664656
If I have an Edge Transport server do I set up this recieve connector on the Edge or the Hub?
0
 
LVL 49

Expert Comment

by:Akhater
ID: 33664689
hub
0
 

Author Comment

by:rbasilides
ID: 33665157
With the extra IP address do I have to adjust my firewall settings since I have all smtp fowarded to my Edge server?
0
 
LVL 49

Expert Comment

by:Akhater
ID: 33665477
no you don't need to change any settings, just add an IP address on the server

again did you read the article?
0
 

Author Comment

by:rbasilides
ID: 33665558
I've read the article and have done exactly what it says but I'm still getting the error.
I created the new conncetor. Set the fqdn. Local IP is set to the new one with port 25. Added the remote IP of the application server. Set permissions group for anonymous users and gave the extended rights.

I really appreciate your help too!
0
 
LVL 49

Expert Comment

by:Akhater
ID: 33665596
ok did you configure the application to use the NEW ip as SMTP service /?
0
 

Author Comment

by:rbasilides
ID: 33665619
Here's a little bit of more background:

This was actually already working before. Did not realize till this past weekend that it was broke. Looking at the logs seems to be that it stopped working right around the time I deployed the Edge Server in out DMZ. At the time when I deployed it I had issues with Symnatec Mail Security which resolved.
0
 
LVL 49

Expert Comment

by:Akhater
ID: 33665707
ok let me try to summarize things in a way I would understand them

1. you have and exchange 2007 server with 2 IPs IPa and IPb
2. you have 2 Receive connectors on your Exchange 2007 server
3. Connector A is configured to listen to all IPs and to accept connections from all IPs
4. Connector B is configured to listen ONLY to IPb and to accept connections ONLY from SQL IPc
5. both connector A and B are listening to port 25
6. you have modified Connector B to allow anonymous relay as per my article
7. you have configured SQL to use IPb (and NOT IPa) port 25 as its SMTP server


am I right in all points ?
0
 

Author Comment

by:rbasilides
ID: 33666147
I got it working by actually setting up the recieve connector on the Edge Server.
0
 
LVL 49

Accepted Solution

by:
Akhater earned 500 total points
ID: 33666160
so you where pointing you SQL to talk with the Edge server and not the hub right ?
0
 

Author Comment

by:rbasilides
ID: 33666176
I guess what I failed to mention is that this is a server that is in a remote location so it's actually hitting mail.company.com from over the internet so it hits the edge server first..
0
 
LVL 49

Expert Comment

by:Akhater
ID: 33666200
:) ok that's it
0
 

Author Comment

by:rbasilides
ID: 33666228
I mistakenly assumed that all edge server settings had to be updated on the hub server thru edge synchronization. Finally started to play around with the edge server and saw that I was able to create recieve connectors on there.
0
 

Author Comment

by:rbasilides
ID: 33666246
I really appreciate you help on this.

For future reference is it best practice if you have an application server internally that needs relaying to use a seperate IP address?
0
 
LVL 49

Expert Comment

by:Akhater
ID: 33666268
yes it is so you don't enable anonymous relaying on the default IP on which everyone has the right to connect.

you create a separate connector on which you allow relaying but you restrict its access to specific IPs
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
In-place Upgrading Dirsync to Azure AD Connect
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question