Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Problems getting Database Mail working

Author  Topic 

ccaltacc
Starting Member

10 Posts

Posted - 2008-07-08 : 22:58:20
I have followed every bit of configuration documentation I can find. I can successfully send a test email with the default profile, but no email is sent when maintenance tasks fail or succeed.

How exactly does it work when successful? For instance, if I setup an on demand maintenance task to backup a database SHOULD Database Mail notify if the job is successful or failure automatically? Or do I need to configure settings for this maintenance to notify me? If that's the case, all I can configure is Operators. And I am under the assumption that if I am using Database Mail I do not need Operators.

This is what I've done:


SQL Agent Service runs as domain user: sqlagent
I added sqlagent to DatabaseMailUserRole in the msdb
I configured a default profile for Data Base mail called default profile with one user attached to it
I set the security on to both public,default=yes and private; sqlagent=default=yes (I have tried this each way)
I set SQL Server Agent to use Database Mail and restarted the service

As I said, I am able to send a test email without problems. How does a "production" email get generated?

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-07-08 : 23:35:21
Did you create operator with correct email address? Did you config job to send mail to operator in notification tab?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-09 : 08:19:49
Did you choose DbMail in SQL agent properties?
Go to Top of Page

ccaltacc
Starting Member

10 Posts

Posted - 2008-07-09 : 08:56:53
quote:
Originally posted by sodeep

Did you choose DbMail in SQL agent properties?



Yes, which I mentioned in the last "step" of my original post

THANKS!
Go to Top of Page

ccaltacc
Starting Member

10 Posts

Posted - 2008-07-09 : 09:01:00
quote:
Originally posted by rmiao

Did you create operator with correct email address? Did you config job to send mail to operator in notification tab?



I used to have an operator specified, but I think that was before I recreated everything (now I have no operator). I wasn't sure if it was necessary because you can only specify one in the notification settings of a job.

However, I will try it again.


THANKS!
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-09 : 16:11:59
You can use as many email as you want. When you send mail through Dbmail in job, you can use operator in profile name.
Go to Top of Page

maninder
Posting Yak Master

100 Posts

Posted - 2008-07-09 : 16:44:04
I will go with rmiao. try that.

Maninder
SQL server Architect / Admin (DEV&PROD)
Go to Top of Page

ccaltacc
Starting Member

10 Posts

Posted - 2008-07-09 : 20:37:05
quote:
Originally posted by rmiao

Did you create operator with correct email address? Did you config job to send mail to operator in notification tab?



This worked. It's odd the way this functions. I have a default dbmail profile with two email address accounts in it.

When I go to my job properties >> notification, there is only one spot to supply a single email address and no more. Which means I can only send to one person in my default dbmail profile

The only way I can send to multiple people is to make a distribution group in AD, then specify that distro group in my default dbmail profile and as the single operator in the job properties.

Why am I able to create multiple email accounts in my dbmail profile, but limited to only a single account in the job properties?

Does this sound familiar to anyone?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-09 : 21:53:04
In job properties, you have to assign operator and under operators you can have multiple email address.
Go to Top of Page

ccaltacc
Starting Member

10 Posts

Posted - 2008-07-11 : 16:08:03
quote:
Originally posted by sodeep

In job properties, you have to assign operator and under operators you can have multiple email address.



Interesting. Do you specify multiple accounts by comma or semicolon?

So what is the point of the dbmail profile and its ability to specify multiple email addresses when you just have to go and put them in again into operators?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-11 : 16:13:55
quote:
Originally posted by ccaltacc

quote:
Originally posted by sodeep

In job properties, you have to assign operator and under operators you can have multiple email address.



Interesting. Do you specify multiple accounts by comma or semicolon?

With Comma

So what is the point of the dbmail profile and its ability to specify multiple email addresses when you just have to go and put them in again into operators?



Thats how we do it.
Go to Top of Page

ccaltacc
Starting Member

10 Posts

Posted - 2008-07-11 : 16:21:50
quote:
Originally posted by sodeep

quote:
Originally posted by ccaltacc

quote:
Originally posted by sodeep

In job properties, you have to assign operator and under operators you can have multiple email address.



Interesting. Do you specify multiple accounts by comma or semicolon?

With Comma

So what is the point of the dbmail profile and its ability to specify multiple email addresses when you just have to go and put them in again into operators?



Thats how we do it.




"Thats how we do it."

Oh sure thing. I wasn't complaining about you or your advise. Just another thing MS implements that makes me scratch my head in puzzlement.

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-11 : 16:37:16
We use mailing lists to email multiple people.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2008-07-11 : 16:40:18
quote:
Originally posted by ccaltacc

quote:
Originally posted by sodeep

In job properties, you have to assign operator and under operators you can have multiple email address.



Interesting. Do you specify multiple accounts by comma or semicolon?

So what is the point of the dbmail profile and its ability to specify multiple email addresses when you just have to go and put them in again into operators?


The multiple email profiles are for specifying addresses that you send FROM. You can only specify one for SQL Agent email.

An agent Operator is addresses that you send TO. You can send to two operators on a job by setting up the email address under Operator pager email name, and setting up the job to send notifications to both email and page.

As mentioned before, you can specify multiple email addresses under an operator, but the size is limited. Usually it will take about three of four addresses, depending on the length. I always separate them with a semi-colon.


CODO ERGO SUM
Go to Top of Page
   

- Advertisement -