Solved

Database Mail

Posted on 2010-09-10
21
648 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
 
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

The problems with reply email signatures

Do you wish that you could place an email signature under a reply? Well, unfortunately, you can't. That great Exchange/Office 365 signature you've created will just appear at the bottom of an email chain. What a pain! Is there really no way to solve this? Well, there might be...

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Intunes without company portal 3 36
Params not declared?  T-SQL syntax question 3 18
Sql query 34 17
SQL Transaction logs 8 6
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
how to add IIS SMTP to handle application/Scanner relays into office 365.

707 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now