Link to home
Start Free TrialLog in
Avatar of Dale Fye
Dale FyeFlag for United States of America

asked on

Configure SQL Server 2008 R2 for database mail

I've never done this before and am having difficulty getting it to work.

I've gone into msdb and added my login to the DatabaseMailUserRole ensured that I have Execute permissions to the sp_Send_dbmail stored procedure.

I then went into the Management => Database Mail and tried to configure the account, but I think this is where I screwed up.  I'm not the Exchange manager in our office and he is unavailable this week, so I would appreciate it if someone could provide me with instructions for how to fill in the various fields on this form.User generated imageI'm honestly unsure how to  fill in the Outgoing SMTP fields.  Should I enter my (sqladmin) email address and display name?  
Where do I get the "Server name" field?
How do I verify whether Port number 25 is open

I'm assuming that I would check the Windows Authentication, which is what the SQL Server uses, but don't know for sure.
Avatar of RantCan
RantCan
Flag of United States of America image

The main problem that you are going to have is whether or not the exchange server is configured with a receive connector that can take mail traffic from your database server. Concomitantly, you need to know if your exchange server is configured for anonymous relay from internal IPs or not, as this will determine the connection credential (or lack thereof)

The rest of the fields are going to be environment specific for your domain, so I doubt the experts will be able to provide valid values for these.
Let me try these questions individually.
I'm honestly unsure how to  fill in the Outgoing SMTP fields.  Should I enter my (sqladmin) email address and display name?
Outgoing email address can be a mailboxed account in the domain, or not. It could simply be "DBServer@yourdomain.com" with no mailbox attached.

Where do I get the "Server name" field? This is the name of your exchange server. Check your outlook settings on your desktop. It might be there.

How do I verify whether Port number 25 is open I assume you mean on the database server? Use the command prompt. Type telnet "server ip" 25

if it is working you will get a 250 OK response. Here is a more detailed explanation: http://dbatasks.blogspot.com/2012/11/troubleshooting-database-mail-part-ii.html

I'm assuming that I would check the Windows Authentication, which is what the SQL Server uses, but don't know for sure.
WIndows Auth allows domain credentials to authenticate and manipulate a SQL instance. IF YOUR EXCHANGE SERVER allows anonymous authentication, use that.

Your exchange admin would be able to answer all of these questions very quickly.
ASKER CERTIFIED SOLUTION
Avatar of Zberteoc
Zberteoc
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dale Fye

ASKER

OK, I was able to get ahold of my Exchange guy and he gave me what he thought were the appropriate settings.  But when I run the test message and check the sysmail_event_Log, I get error message:

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2015-10-27T12:20:45). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Unable to relay).

So the question is, what mailbox is unavailable?  The email the Exchange guy told me to put in to the outgoing email address is the Outlook email account associated with my server login.  Is that correct?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, this was a great help.