Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Notifications - db_send_mail works, Notifications don't

Status
Not open for further replies.

RRinTetons

IS-IT--Management
Jul 4, 2001
333
US
I posted this last week in the Programming section and didn't get anything back. Anybody here have any ideas?
--------------------------------------------------------

SQL Server 2008 R2

I have a test job with 3 steps.

Step 1 generates a success or a fail

Step 2 uses sp_send_dbmail to send a success email

Step 3 uses sp_send_dbmail to send a failure email

That all works fine.

I'd LIKE to just use the job notification system, but for whatever reason it won't send. To test, I disable the steps 2 & 3 and enable the job notification. I've got an Operator with the same email address used in the db_send_mail steps, so I know that part works, but it just never sends. I've checked the mail queues and it never even shows up.

I thought job notifications basically just use db_send_mail? Any suggestions on what I've missed?

-
Richard Ray
Jackson Hole Mountain Resort
 
I've done some comparison with my systems and here is what I think the issue (and solution) might be.

I believe when you send an email using sp_send_dbmail, it uses the SQL Server Agent service account. When you send mail via Notifications, it needs to use a Mail Profile to send from.

Now, I'm not positive about that...but I know all our Notifications have the default mail profile as the From.

To test this theory, go to Management and right click on Database Mail. Select Configure Database Mail. Then chose the option to Set Up Database Mail. Follow the steps to set up a mail account/profile.

Then test your Notifications.

-SQLBill



The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Close. Oneof my guys figured it out yestertday afternoon. The SQL Agent setup has a Mail Access setup that has to be ernabled completely separate from everythng else. Done now. and it works.

-
Richard Ray
Jackson Hole Mountain Resort
 
That's good to know...thanks for posting the solution.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top