SQL Database Email

soadmin
soadmin used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Run the below command and try it

CREATE USER [DomainName\Username]

Author

Commented:
Hi Gottler, what do I run this against?  I apologize, but I don't know transact sql at all, just the SQL SMS.

Commented:
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.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
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?

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

Author

Commented:
Hello,

Here is a screenshot of the issue:

no email in pulldown
Professional Troublemaker^h^h^h^h^hshooter
Commented:
Under SQL Server Agent, create a new operator and give that operator an email address.

Author

Commented:
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!
Jason SchlueterIT Manager

Commented:
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 WeisslerProfessional Troublemaker^h^h^h^h^hshooter

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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial