Database Mail Error

  • This is a recent install of SQL Server 2008 R2 in a Windows Server 2008 R2 64 bit environment (which I wasn't a part of). The Database Mail is enabled and I've configured a profile. I have my server's name as the Server Name for the SMTP Outgoing mail server with Port Number 25 using Anonymous Authentication. The Public Profiles checkbox is checked and set as the Default Profile, while nothing checked in Private Profiles. I send a test email by right clicking on Database Mail and never get the email. I check the sysmail_event_log and get this as the error message:

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2012-10-19T14:23:37). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Unable to relay for testuser@company.com). )

    I've tried all sorts of steps to troubleshoot this issue but everything I tried did not work. I have Norton Endpoint Protection and disabled that before sending a test email just in case Norton is blocking DB Mail. The Windows Firewall is Disabled. I changed the Profile Settings and tried checking/unchecking boxes. I even used GMail as the SMTP server by using smtp.gmail.com port 587 but I received a "time out" message.

    Prior to getting this message I need help with I was getting:

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2012-10-11T13:23:28). Exception Message: Could not connect to mail server. (No connection could be made because the target machine actively refused it "ServerIP:25"). )

    But was able to get around this by installing IIS.

    Any suggestions on what else I can do to troubleshoot the "Unable to Relay" issue?

  • you may check with you Exchange Admin and make sure setup relay service in Exchange Server.

  • DBA328 (10/19/2012)


    you may check with you Exchange Admin and make sure setup relay service in Exchange Server.

    Do I need this server to be connected to or be part of the Exchange Server in order for DB Mail to work?

  • mrtrich99 (10/19/2012)


    The server response was: 5.7.1 Unable to relay for testuser@company.com). )

    .............

    ...........Any suggestions on what else I can do to troubleshoot the "Unable to Relay" issue?

    You're sending an email from an address not authorised on your mail server. You will need to speak to our mail server admin to identify a valid email address for your domain.

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • relaying is forwarding/sending to email addresses that are not administered by the specific server you are conecting to...for example, if my server is the google's gmail, then emails to @sqlservercentral.com would be relayed from gmail to SSC; emails @gmail.com are on that server, and just go thru standard spam filtering before being delivered.

    the default settings of any mail server are designed to prevent the server from being able to relay "spam"

    to avoid all those viagra and male enhancement pills and stuff like that, a mail server is set up typically only allows relaying in two situations.

    1. If using anonymous authentication, only mail coming from IP addresses already placed in the white-list get to relay; this is typically where the IP address of the webserver(or in this case, a SQL Server) has been added to the list of permitted machines. That's where you get with the administrator of the mail server, to add your IP.

    A lot of times the server allows any machine on the internal LAN to relay by default.

    2. instead of anonymous authentication, you use basic authentication, and provide a username and password. Because you are an actual user, In that situation, the mail server usually allows relaying. some servers require both...an account and also the IP address to be on the "white-list" of allowed machines

    try switching to use a valid account first, instead of anonymous authentication. if that fails, get with your mail admin.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • i tried the googlemail way and got this error message.

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2012-10-22T14:47:52). Exception Message: Could not connect to mail server. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 173.194.79.16:587). )

    So why is the googlemail way still erroring out? i made sure the login credentials were correct.

    now, what i failed to mention about is even though this server is for one company, the mail server is on one domain while this is on a different domain. Could that be the reason why I can't send out DB mails from this server? I have not contacted anyone from tech support to see if they can include this server IP on the white list.

  • Perry Whittle (10/20/2012)


    mrtrich99 (10/19/2012)


    The server response was: 5.7.1 Unable to relay for testuser@company.com). )

    .............

    ...........Any suggestions on what else I can do to troubleshoot the "Unable to Relay" issue?

    You're sending an email from an address not authorised on your mail server. You will need to speak to our mail server admin to identify a valid email address for your domain.

    Hi everyone, i'm still trying to resolve this issue. I submitted a ticket to my mail server admin but have not heard back from them. Do I really need to get this server synced up with the mail server in order for it to work? I thought DB Mail in SQL 2008 can function independent without having to interact with the Outlook Exchange server?

    As mentioned above using the gmail SMTP server resulted in an error for me.

  • mrtrich99 (10/24/2012)


    Perry Whittle (10/20/2012)


    mrtrich99 (10/19/2012)


    The server response was: 5.7.1 Unable to relay for testuser@company.com). )

    .............

    ...........Any suggestions on what else I can do to troubleshoot the "Unable to Relay" issue?

    You're sending an email from an address not authorised on your mail server. You will need to speak to our mail server admin to identify a valid email address for your domain.

    Hi everyone, i'm still trying to resolve this issue. I submitted a ticket to my mail server admin but have not heard back from them. Do I really need to get this server synced up with the mail server in order for it to work? I thought DB Mail in SQL 2008 can function independent without having to interact with the Outlook Exchange server?

    As mentioned above using the gmail SMTP server resulted in an error for me.

    No, the google mail server will not relay mail for your domain.

    Db mail merely moves the mail profile from the mail server to the sql server. You still need to route through a mail server that is authorative for your domain.

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • You can only route your mail through google mail or windows live if you have a gmail or live account. You will not be able to route email for dbaalerter@Fredblogs.com through the Live or Gmail servers, they will actively reject it!!!!

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Perry Whittle (10/25/2012)


    You can only route your mail through google mail or windows live if you have a gmail or live account. You will not be able to route email for dbaalerter@Fredblogs.com through the Live or Gmail servers, they will actively reject it!!!!

    After speaking with the help desk they informed me that they set up this server differently than all the others in the domain. Even there's no local firewall on the server, there put a block on certain ports from from the global firewall. They asked if using the company's SMTP server name will resolve the issue and it did.

  • Viewing 11 posts - 1 through 10 (of 10 total)

    You must be logged in to reply to this topic. Login to reply