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
Microsoft SQL Server 2008Microsoft SQL Server

Avatar of undefined
Last Comment
Rich Weissler

8/22/2022 - Mon
SOLUTION
Gottler

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
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.
Gottler

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.
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?
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Gottler

No. I am not getting it as its midnight here(IST) :(
soadmin

ASKER
Hello,

Here is a screenshot of the issue:

no email in pulldown
ASKER CERTIFIED SOLUTION
Rich Weissler

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
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!
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Jason Schlueter

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.
Rich Weissler

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.)