Link to home
Start Free TrialLog in
Avatar of soadmin
soadmin

asked on

SQL Database Email

Hello,

I'm having a heck of a time getting SQL email working.  I have went through the following steps:

1.  Create DB mail account: http://technet.microsoft.com/en-us/library/ms190658.aspx
2.  Create DB mail profile: http://technet.microsoft.com/en-us/library/ms187605.aspx

And here is where I get stuck: http://msdn.microsoft.com/en-us/library/ms186358.aspx

When I go to the DatabaseMailUserRole in the msdb database and try and add my domain account that the sql server agent runs under, it will not allow me to do so.  It says it cannot find the account.  

I know I must be missing something fairly simple, but need your help.

Thanks,

Soadmin
SOLUTION
Avatar of Gottler
Gottler

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 soadmin
soadmin

ASKER

Hi Gottler, what do I run this against?  I apologize, but I don't know transact sql at all, just the SQL SMS.
You have SQL Server Management Studio right. Then Open a new Query window and execute the command.

DomainName is the name of your domain that the use belongs to and Username is the login name of the user in the domain.
Avatar of soadmin

ASKER

I got it.  I didn't realize I had to create that account withing the msdb database.  I appreciate it.  Now, when I go into a scheduled job, I go to notifications and select email, but nothing is in the pulldown.  Any ideas?
No. I am not getting it as its midnight here(IST) :(
Avatar of soadmin

ASKER

Hello,

Here is a screenshot of the issue:

User generated image
ASKER CERTIFIED SOLUTION
Avatar of Rich Weissler
Rich Weissler

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 soadmin

ASKER

Hi Razmus, did I need to do the previous steps I mentioned as well as creating an account with the msdb database or does just creating an operator do the same?  I did what you suggested and it now works.  Thank you!
An operator is independent of an SQL user.  If you want to list multiple e mail addresses in the New Operator dialog box, separate them with a semicolon (no spaces).  Give that a name and it will appear in the drop down menu.
Database mail does need to be set-up and configured correctly.  I'm not 100% certain if the earlier steps helped.  (*shrugs.apologetically*)  I was responding to the screen shot you posted, and was pretty certain what needed to be done from that point.  :-)  (Usually, if DataBaseMail is configured correctly, and you can send a test message from that option in Management Studio, normally you'd just need to define SQL Agent operators to be able to send those notifications.)