February 22, 2012 at 12:00 pm
I created a job which sends a notification email upon completion. In the notification email, the FROM: line shows a group which is not the Operator, nor in any of the DBMail profiles or accounts which are set up on the instance.
Anyone know where the FROM: line is populated from in these job notifications?
February 22, 2012 at 12:36 pm
I give up! What group is in the FROM line? 🙂
Jared
CE - Microsoft
February 23, 2012 at 1:07 am
if you do
select * from msdb.dbo.sysmail_account
do you see the email address in either the email_address or replyto_address columns?
February 23, 2012 at 8:36 am
In looking at results from 'select * from msdb.dbo.sysmail_account' I do see the display name for another count is what's showing in the FROM: of the notification email. However, why is it using this display name? It should be using the display name for the account the actual Operator is associated with. Ideas?
February 23, 2012 at 8:42 am
The mail profile that the database mail uses to send is mutually exclusive from the operator; they are unrelated. An operator is who it sends to in this case. The mail profile is what it uses to send. Operators != Mail Account
Jared
CE - Microsoft
February 23, 2012 at 8:47 am
rocky (2/23/2012)
In looking at results from 'select * from msdb.dbo.sysmail_account' I do see the display name for another count is what's showing in the FROM: of the notification email. However, why is it using this display name? It should be using the display name for the account the actual Operator is associated with. Ideas?
The email will be sent from SQL with whatever mail account it was sent with
So for example I have two mail accounts MA1 and MA2, there assigned emails are MA1@MyDomain.com and MA2@MyDomain.com. When I do sp_send_dbmail using MA1 as the account, I will get an email from MA1@MyDomain.com.
If your not specifying a profile for it to use on the send it will pick the default.
In the Alerts tab on SQL Agent you should have specified a mail profile, make a note of the profile, and then look in msdb.dbo.symail_profile for the name, make a note of the profile_id, look in sysmail_profileaccount for the profile id, make a not of the account id then look in sysmail account for the account id.
February 23, 2012 at 8:51 am
anthony.green (2/23/2012)
rocky (2/23/2012)
In looking at results from 'select * from msdb.dbo.sysmail_account' I do see the display name for another count is what's showing in the FROM: of the notification email. However, why is it using this display name? It should be using the display name for the account the actual Operator is associated with. Ideas?The email will be sent from SQL with whatever mail account it was sent with
So for example I have two mail accounts MA1 and MA2, there assigned emails are MA1@MyDomain.com and MA2@MyDomain.com. When I do sp_send_dbmail using MA1 as the account, I will get an email from MA1@MyDomain.com.
If your not specifying a profile for it to use on the send it will pick the default.
In the Alerts tab on SQL Agent you should have specified a mail profile, make a note of the profile, and then look in msdb.dbo.symail_profile for the name, make a note of the profile_id, look in sysmail_profileaccount for the profile id, make a not of the account id then look in sysmail account for the account id.
Anthony, I think the OP is confusing Operators in an Email Notification (Notification tab of job) with the DB Mail profiles.
Jared
CE - Microsoft
February 23, 2012 at 9:03 am
yep i got that too
February 23, 2012 at 9:06 am
I appreciate the replies.
I did the selects on the system tables like anthonly suggested.
I see 3 dbmail profiles and accounts. when ANY job on the instance completes it sends an email notification. ALL job notifications are being sent FROM 1 account's display_name rather than the display_name of the various accounts.
February 23, 2012 at 9:09 am
rocky (2/23/2012)
I appreciate the replies.I did the selects on the system tables like anthonly suggested.
I see 3 dbmail profiles and accounts. when ANY job on the instance completes it sends an email notification. ALL job notifications are being sent FROM 1 account's display_name rather than the display_name of the various accounts.
Let me ask you a simple question... When you create a job, where do you specify the account that is SENDING the email?
Jared
CE - Microsoft
February 23, 2012 at 9:12 am
i don't.
the default should be set when u enable dbmail. this is the issue... the dfault shows as account 2 while the emails show as FROM account 3.
February 23, 2012 at 9:14 am
When did the default change from account3 to account2?
Jared
CE - Microsoft
February 23, 2012 at 9:16 am
Sorry... My point there was that the default has been changed, but SQL Agent probably has not been restarted.
Jared
CE - Microsoft
February 23, 2012 at 9:17 am
your not confusing the default mail profile in the actual database mail configuration page for the mail profile sql agent is using are you?
February 23, 2012 at 9:18 am
SQLKnowItAll (2/23/2012)
Sorry... My point there was that the default has been changed, but SQL Agent probably has not been restarted.
Forgot about that, always catches me out, something so simple
Viewing 15 posts - 1 through 15 (of 28 total)
You must be logged in to reply to this topic. Login to reply