Saturday, February 25, 2012

database mail problem...Query execution failed: Error initializing COM

Hello -

I'm having a problem sending the query set as an email text attachment. Test transmissions from Database mail working fine.

Send simple messages with the sp_send_dbmail sproc works fine as well.

It is only when I try and send a query result that things blow up. The query itself is working fine also, so I'm now down to think there is some esoteric problem with the sproc itself.

Surface config features have database mail on, and SQL Mail off.

Anyone know the solution to this?

Thanks in advance!

Actual SQL ...

use epic
go

EXEC msdb.dbo.sp_send_dbmail
@.profile_name = 'SQLMail',
@.recipients = 'rvolters@.whaleyfoodservice.com',
@.body = 'Testing sqlmail with sproc.',
@.subject = 'Orders with invalid tech numbers',
@.query = 'SELECT order_no, order_ext, line_no from epic..STG_BNERPT_INVALIDTECHNOS' ,
@.attach_query_result_as_file = 1 ;

Message Results...

Msg 14661, Level 16, State 1, Procedure sp_send_dbmail, Line 476
Query execution failed: Error initializing COM
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.

Investigating the sproc itself shows...


Line 476 in the sproc is the beginning of a 'trap'
--Raise an error it the query execution fails
-- This will only be the case when @.append_query_error is set to 0 (false)
IF( (@.RetErrorMsg IS NOT NULL) AND (@.exclude_query_output=0) )
BEGIN
RAISERROR(14661, -1, -1, @.RetErrorMsg)
END

RETURN (@.rc)
this is the last section of code in the sproc

I have a very similar issue.

When i execute the following everything work 100%.

EXEC msdb.dbo.sp_send_dbmail

@.profile_name = 'DBA Mail',

@.recipients = me@.whatever.co.za',

@.body = 'Test email from server using dbmail',

@.subject = 'Test email from server using dbmail',

@.query = 'SELECT TOP 1 * FROM TABLE A Order by AlertDTTM DESC' ;

As soon as i put this exact code in a trigger i get the following error:

Msg 22050, Level 16, State 1, Line 0

Error formatting query, probably invalid parameters

Msg 14661, Level 16, State 1, Procedure sp_send_dbmail, Line 478

Query execution failed: Error Intiailizing COM . CoInitialize failed with Hresult: 0x80010106

Anyone ?

Database Mail Operator Question

I have two jobs configured to e-mail myself on completion, but I am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific private profile. Of note is that the button to "Test" the mail profile is grayed out on the Alert System tab. When I execute sp_send_dbmail using the e-mail address from the operator and use the profile name defined in the SQL Agent properties, I receive an e-mail. However the jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the sysmail_profile table. The e-mail does not appear in sysmail_mailitems and sysmail_send_retries is empty. So the job notification is not getting queued.
Any ideas?
Thank-you,
Rubens
It is running under a domain account that is an administrator on the server, which is the same account the SQL Server service is running under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but I am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific private profile. Of note is that the button to "Test" the mail profile is grayed out on the Alert System tab. When I execute sp_send_dbmail using the e-mail address from the operator and use the profile name defined in the SQL Agent properties, I receive an e-mail. However the jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the sysmail_profile table. The e-mail does not appear in sysmail_mailitems and sysmail_send_retries is empty. So the job notification is not getting queued.
Any ideas?
Thank-you,
Rubens
|||Hmmm, come to think of it, no I wasn't. I will have to test that when back in the office tomorrow. I will let you know.
Thanks John.
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message news:erH9oGOmIHA.1184@.TK2MSFTNGP04.phx.gbl...
Hi
And were you logged in as this account when you tested sp_send_dbmail?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message news:%23A5C6DOmIHA.5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account that is an administrator on the server, which is the same account the SQL Server service is running under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but I am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific private profile. Of note is that the button to "Test" the mail profile is grayed out on the Alert System tab. When I execute sp_send_dbmail using the e-mail address from the operator and use the profile name defined in the SQL Agent properties, I receive an e-mail. However the jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the sysmail_profile table. The e-mail does not appear in sysmail_mailitems and sysmail_send_retries is empty. So the job notification is not getting queued.
Any ideas?
Thank-you,
Rubens
|||Yes, I was able to send an e-mail using T-SQL when logged in with the account the SQL Server service / agent was using. I was able to fix the problem, although I am not sure if it's a permanent solution.
The job operator e-mail address was a distribution list on Exchange. I changed the e-mail address to include my own, ran the job, and one alert came through fine. Then I sent it only to my account, again, worked fine. I then retyped the operator e-mail address back in of the distribution list and it succeeded. The one thing I am positive of is that the e-mail address was correct right from the start because I use the same e-mail address in the Pagers section. This was and is identical to what was in the E-mail name of the operator.
Does this sound like a bug? I guess it's a little concerning considering one of the benefits of database mail is it being SMTP based and supposed to be a lot more reliable.
Thanks,
Rubens
"Rubens" <rubensrose@.hotmail.com> wrote in message news:e1A60tPmIHA.2268@.TK2MSFTNGP02.phx.gbl...
Hmmm, come to think of it, no I wasn't. I will have to test that when back in the office tomorrow. I will let you know.
Thanks John.
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message news:erH9oGOmIHA.1184@.TK2MSFTNGP04.phx.gbl...
Hi
And were you logged in as this account when you tested sp_send_dbmail?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message news:%23A5C6DOmIHA.5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account that is an administrator on the server, which is the same account the SQL Server service is running under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but I am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific private profile. Of note is that the button to "Test" the mail profile is grayed out on the Alert System tab. When I execute sp_send_dbmail using the e-mail address from the operator and use the profile name defined in the SQL Agent properties, I receive an e-mail. However the jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the sysmail_profile table. The e-mail does not appear in sysmail_mailitems and sysmail_send_retries is empty. So the job notification is not getting queued.
Any ideas?
Thank-you,
Rubens
|||I've just noticed another issue. I've created all my maintenance plans using the wizard. When I go into the "Reporting and Logging" section for the maintenance plan, I've selected the "Send report to an email recipient" check box, the recipient being the same one that the job alert sends to. However, I am not receiving the e-mail report. Instead, I am only getting an e-mail from the job saying it has completed. I don't get a report from the maintenance plan. I have also confirmed that the logging file is created in a folder on the server.
Any idea why I am not getting this report in an e-mail?
Thank-you,
Rubens
"Rubens" <rubensrose@.hotmail.com> wrote in message news:eC7QYMXmIHA.5684@.TK2MSFTNGP03.phx.gbl...
Yes, I was able to send an e-mail using T-SQL when logged in with the account the SQL Server service / agent was using. I was able to fix the problem, although I am not sure if it's a permanent solution.
The job operator e-mail address was a distribution list on Exchange. I changed the e-mail address to include my own, ran the job, and one alert came through fine. Then I sent it only to my account, again, worked fine. I then retyped the operator e-mail address back in of the distribution list and it succeeded. The one thing I am positive of is that the e-mail address was correct right from the start because I use the same e-mail address in the Pagers section. This was and is identical to what was in the E-mail name of the operator.
Does this sound like a bug? I guess it's a little concerning considering one of the benefits of database mail is it being SMTP based and supposed to be a lot more reliable.
Thanks,
Rubens
"Rubens" <rubensrose@.hotmail.com> wrote in message news:e1A60tPmIHA.2268@.TK2MSFTNGP02.phx.gbl...
Hmmm, come to think of it, no I wasn't. I will have to test that when back in the office tomorrow. I will let you know.
Thanks John.
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message news:erH9oGOmIHA.1184@.TK2MSFTNGP04.phx.gbl...
Hi
And were you logged in as this account when you tested sp_send_dbmail?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message news:%23A5C6DOmIHA.5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account that is an administrator on the server, which is the same account the SQL Server service is running under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but I am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific private profile. Of note is that the button to "Test" the mail profile is grayed out on the Alert System tab. When I execute sp_send_dbmail using the e-mail address from the operator and use the profile name defined in the SQL Agent properties, I receive an e-mail. However the jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the sysmail_profile table. The e-mail does not appear in sysmail_mailitems and sysmail_send_retries is empty. So the job notification is not getting queued.
Any ideas?
Thank-you,
Rubens

Database Mail Operator Question

This is a multi-part message in MIME format.
--=_NextPart_000_002A_01C89897.E2CD2D00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have two jobs configured to e-mail myself on completion, but I am not = currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific = private profile. Of note is that the button to "Test" the mail profile = is grayed out on the Alert System tab. When I execute sp_send_dbmail = using the e-mail address from the operator and use the profile name = defined in the SQL Agent properties, I receive an e-mail. However the = jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the = sysmail_profile table. The e-mail does not appear in sysmail_mailitems = and sysmail_send_retries is empty. So the job notification is not = getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_002A_01C89897.E2CD2D00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
I have two jobs configured to e-mail = myself on completion, but I am not currently receiving these notifications.

The SQL Agent is configured to use = database mail, with a specific private profile. Of note is that the button to = "Test" the mail profile is grayed out on the Alert System tab. When I execute = sp_send_dbmail using the e-mail address from the operator and use the = profile name defined in the SQL Agent properties, I receive an e-mail. = However the jobs themselves are not sending me any e-mail.

I've also confirmed the correct name of = the profile in the sysmail_profile table. The e-mail does not appear in sysmail_mailitems and sysmail_send_retries is empty. So the job notification is not getting queued.

Any ideas?

Thank-you,
Rubens
--=_NextPart_000_002A_01C89897.E2CD2D00--This is a multi-part message in MIME format.
--=_NextPart_000_0065_01C898E3.854A0D00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but I am =not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific =private profile. Of note is that the button to "Test" the mail profile =is grayed out on the Alert System tab. When I execute sp_send_dbmail =using the e-mail address from the operator and use the profile name =defined in the SQL Agent properties, I receive an e-mail. However the =jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the =sysmail_profile table. The e-mail does not appear in sysmail_mailitems =and sysmail_send_retries is empty. So the job notification is not =getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_0065_01C898E3.854A0D00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Hi
What account is SQL Agent running under?
John
"Rubens" =wrote in message news:%23Tec6mLmIHA.=3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail =myself on completion, but I am not currently receiving these notifications.

The SQL Agent is configured to use =database mail, with a specific private profile. Of note is that the button to ="Test" the mail profile is grayed out on the Alert System tab. When I =execute sp_send_dbmail using the e-mail address from the operator and use the =profile name defined in the SQL Agent properties, I receive an e-mail. =However the jobs themselves are not sending me any e-mail.

I've also confirmed the correct name =of the profile in the sysmail_profile table. The e-mail does not appear =in sysmail_mailitems and sysmail_send_retries is empty. So the job notification is not getting queued.

Any ideas?

Thank-you,
Rubens

--=_NextPart_000_0065_01C898E3.854A0D00--|||This is a multi-part message in MIME format.
--=_NextPart_000_0067_01C898BF.22C59A10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
It is running under a domain account that is an administrator on the =server, which is the same account the SQL Server service is running =under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but I am =not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific =private profile. Of note is that the button to "Test" the mail profile =is grayed out on the Alert System tab. When I execute sp_send_dbmail =using the e-mail address from the operator and use the profile name =defined in the SQL Agent properties, I receive an e-mail. However the =jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the =sysmail_profile table. The e-mail does not appear in sysmail_mailitems =and sysmail_send_retries is empty. So the job notification is not =getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_0067_01C898BF.22C59A10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

It is running under a domain account =that is an administrator on the server, which is the same account the SQL Server =service is running under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" wrote in message news:O6%231lsNmIHA.=1208@.TK2MSFTNGP05.phx.gbl...
Hi

What account is SQL Agent running under?

John
"Rubens" =wrote in message news:%23Tec6mLmIHA.=3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to =e-mail myself on completion, but I am not currently receiving these notifications.

The SQL Agent is configured to use =database mail, with a specific private profile. Of note is that the =button to "Test" the mail profile is grayed out on the Alert System tab. =When I execute sp_send_dbmail using the e-mail address from the operator =and use the profile name defined in the SQL Agent properties, I receive an e-mail. However the jobs themselves are not sending me any e-mail.

I've also confirmed the correct =name of the profile in the sysmail_profile table. The e-mail does not =appear in sysmail_mailitems and sysmail_send_retries is empty. So the =job notification is not getting queued.

Any ideas?

Thank-you,
Rubens

--=_NextPart_000_0067_01C898BF.22C59A10--|||This is a multi-part message in MIME format.
--=_NextPart_000_0084_01C898EA.086587E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi
And were you logged in as this account when you tested sp_send_dbmail?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23A5C6DOmIHA.5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account that is an administrator on the =server, which is the same account the SQL Server service is running =under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but I =am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific =private profile. Of note is that the button to "Test" the mail profile =is grayed out on the Alert System tab. When I execute sp_send_dbmail =using the e-mail address from the operator and use the profile name =defined in the SQL Agent properties, I receive an e-mail. However the =jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the =sysmail_profile table. The e-mail does not appear in sysmail_mailitems =and sysmail_send_retries is empty. So the job notification is not =getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_0084_01C898EA.086587E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Hi
And were you logged in as this account =when you tested sp_send_dbmail?
John
"Rubens" =wrote in message news:%23A5C6DOmIHA.=5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account =that is an administrator on the server, which is the same account the SQL Server =service is running under (I haven't split them up and restricted it as is recommended).

Thank-you,
Rubens
"John Bell" wrote in message news:O6%231lsNmIHA.=1208@.TK2MSFTNGP05.phx.gbl...
Hi

What account is SQL Agent running under?

John
"Rubens" =wrote in message news:%23Tec6mLmIHA.=3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to =e-mail myself on completion, but I am not currently receiving these notifications.

The SQL Agent is configured to =use database mail, with a specific private profile. Of note is that the =button to "Test" the mail profile is grayed out on the Alert System =tab. When I execute sp_send_dbmail using the e-mail address from the =operator and use the profile name defined in the SQL Agent properties, I =receive an e-mail. However the jobs themselves are not sending me any e-mail.

I've also confirmed the correct =name of the profile in the sysmail_profile table. The e-mail does not =appear in sysmail_mailitems and sysmail_send_retries is empty. So the =job notification is not getting queued.

Any ideas?

Thank-you,
Rubens

--=_NextPart_000_0084_01C898EA.086587E0--|||This is a multi-part message in MIME format.
--=_NextPart_000_0012_01C898D9.9D37BCA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hmmm, come to think of it, no I wasn't. I will have to test that when =back in the office tomorrow. I will let you know.
Thanks John.
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:erH9oGOmIHA.1184@.TK2MSFTNGP04.phx.gbl...
Hi
And were you logged in as this account when you tested sp_send_dbmail?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23A5C6DOmIHA.5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account that is an administrator on the =server, which is the same account the SQL Server service is running =under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but I =am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a =specific private profile. Of note is that the button to "Test" the mail =profile is grayed out on the Alert System tab. When I execute =sp_send_dbmail using the e-mail address from the operator and use the =profile name defined in the SQL Agent properties, I receive an e-mail. =However the jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the =sysmail_profile table. The e-mail does not appear in sysmail_mailitems =and sysmail_send_retries is empty. So the job notification is not =getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_0012_01C898D9.9D37BCA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Hmmm, come to think of it, no I =wasn't. I will have to test that when back in the office tomorrow. I will =let you know.
Thanks John.
Rubens
"John Bell" wrote in message news:erH9oGOmIHA.1184=@.TK2MSFTNGP04.phx.gbl...
Hi

And were you logged in as this =account when you tested sp_send_dbmail?

John
"Rubens" =wrote in message news:%23A5C6DOmIHA.=5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain =account that is an administrator on the server, which is the same account the SQL =Server service is running under (I haven't split them up and restricted it =as is recommended).

Thank-you,
Rubens
"John Bell" wrote in message news:O6%231lsNmIHA.=1208@.TK2MSFTNGP05.phx.gbl...
Hi

What account is SQL Agent running = under?

John
"Rubens" wrote in message news:%23Tec6mLmIHA.=3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to =e-mail myself on completion, but I am not currently receiving these notifications.

The SQL Agent is configured to =use database mail, with a specific private profile. Of note is that the =button to "Test" the mail profile is grayed out on the Alert System =tab. When I execute sp_send_dbmail using the e-mail address from the =operator and use the profile name defined in the SQL Agent properties, I =receive an e-mail. However the jobs themselves are not sending me =any e-mail.

I've also confirmed the correct =name of the profile in the sysmail_profile table. The e-mail does not =appear in sysmail_mailitems and sysmail_send_retries is empty. So =the job notification is not getting queued.

Any ideas?

Thank-you,
Rubens

--=_NextPart_000_0012_01C898D9.9D37BCA0--|||This is a multi-part message in MIME format.
--=_NextPart_000_000E_01C89951.401BBEE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Yes, I was able to send an e-mail using T-SQL when logged in with the =account the SQL Server service / agent was using. I was able to fix the =problem, although I am not sure if it's a permanent solution.
The job operator e-mail address was a distribution list on Exchange. I =changed the e-mail address to include my own, ran the job, and one alert =came through fine. Then I sent it only to my account, again, worked =fine. I then retyped the operator e-mail address back in of the =distribution list and it succeeded. The one thing I am positive of is =that the e-mail address was correct right from the start because I use =the same e-mail address in the Pagers section. This was and is =identical to what was in the E-mail name of the operator.
Does this sound like a bug? I guess it's a little concerning =considering one of the benefits of database mail is it being SMTP based =and supposed to be a lot more reliable.
Thanks,
Rubens
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:e1A60tPmIHA.2268@.TK2MSFTNGP02.phx.gbl...
Hmmm, come to think of it, no I wasn't. I will have to test that when =back in the office tomorrow. I will let you know.
Thanks John.
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:erH9oGOmIHA.1184@.TK2MSFTNGP04.phx.gbl...
Hi
And were you logged in as this account when you tested =sp_send_dbmail?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23A5C6DOmIHA.5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account that is an administrator on =the server, which is the same account the SQL Server service is running =under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but =I am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a =specific private profile. Of note is that the button to "Test" the mail =profile is grayed out on the Alert System tab. When I execute =sp_send_dbmail using the e-mail address from the operator and use the =profile name defined in the SQL Agent properties, I receive an e-mail. =However the jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the =sysmail_profile table. The e-mail does not appear in sysmail_mailitems =and sysmail_send_retries is empty. So the job notification is not =getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_000E_01C89951.401BBEE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Yes, I was able to send an e-mail using =T-SQL when logged in with the account the SQL Server service / agent was =using. I was able to fix the problem, although I am not sure if it=92s a permanent solution.
The job operator e-mail address was a =distribution list on Exchange. I changed the e-mail address to include my =own, ran the job, and one alert came through fine. Then I sent it only to =my account, again, worked fine. I then retyped the operator e-mail =address back in of the distribution list and it succeeded. The one thing I =am positive of is that the e-mail address was correct right from the start =because I use the same e-mail address in the Pagers section. This was and =is identical to what was in the E-mail name of the operator.
Does this sound like a bug? I =guess it=92s a little concerning considering one of the benefits of database mail is it =being SMTP based and supposed to be a lot more reliable.
Thanks,
Rubens
"Rubens" =wrote in message news:e1A60tPmIHA.2268=@.TK2MSFTNGP02.phx.gbl...
Hmmm, come to think of it, no I =wasn't. I will have to test that when back in the office tomorrow. I will =let you know.

Thanks John.

Rubens
"John Bell" wrote in message news:erH9oGOmIHA.1184=@.TK2MSFTNGP04.phx.gbl...
Hi

And were you logged in as this =account when you tested sp_send_dbmail?

John
"Rubens" =wrote in message news:%23A5C6DOmIHA.=5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain =account that is an administrator on the server, which is the same account the SQL =Server service is running under (I haven't split them up and restricted =it as is recommended).

Thank-you,
Rubens
"John Bell" wrote in message news:O6%231lsNmIHA.=1208@.TK2MSFTNGP05.phx.gbl...
Hi

What account is SQL Agent =running under?

John
"Rubens" wrote in message news:%23Tec6mLmIHA.=3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to =e-mail myself on completion, but I am not currently receiving =these notifications.

The SQL Agent is configured =to use database mail, with a specific private profile. Of note =is that the button to "Test" the mail profile is grayed out on the =Alert System tab. When I execute sp_send_dbmail using the =e-mail address from the operator and use the profile name defined in =the SQL Agent properties, I receive an e-mail. However the jobs themselves are not sending me any e-mail.

I've also confirmed the =correct name of the profile in the sysmail_profile table. The e-mail =does not appear in sysmail_mailitems and sysmail_send_retries is =empty. So the job notification is not getting queued.

Any ideas?

Thank-you,
Rubens

--=_NextPart_000_000E_01C89951.401BBEE0--|||This is a multi-part message in MIME format.
--=_NextPart_000_0019_01C89953.299E61C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I've just noticed another issue. I've created all my maintenance plans =using the wizard. When I go into the "Reporting and Logging" section =for the maintenance plan, I've selected the "Send report to an email =recipient" check box, the recipient being the same one that the job =alert sends to. However, I am not receiving the e-mail report. =Instead, I am only getting an e-mail from the job saying it has =completed. I don't get a report from the maintenance plan. I have also =confirmed that the logging file is created in a folder on the server.
Any idea why I am not getting this report in an e-mail?
Thank-you,
Rubens
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:eC7QYMXmIHA.5684@.TK2MSFTNGP03.phx.gbl...
Yes, I was able to send an e-mail using T-SQL when logged in with the =account the SQL Server service / agent was using. I was able to fix the =problem, although I am not sure if it's a permanent solution.
The job operator e-mail address was a distribution list on Exchange. =I changed the e-mail address to include my own, ran the job, and one =alert came through fine. Then I sent it only to my account, again, =worked fine. I then retyped the operator e-mail address back in of the =distribution list and it succeeded. The one thing I am positive of is =that the e-mail address was correct right from the start because I use =the same e-mail address in the Pagers section. This was and is =identical to what was in the E-mail name of the operator.
Does this sound like a bug? I guess it's a little concerning =considering one of the benefits of database mail is it being SMTP based =and supposed to be a lot more reliable.
Thanks,
Rubens
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:e1A60tPmIHA.2268@.TK2MSFTNGP02.phx.gbl...
Hmmm, come to think of it, no I wasn't. I will have to test that =when back in the office tomorrow. I will let you know.
Thanks John.
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:erH9oGOmIHA.1184@.TK2MSFTNGP04.phx.gbl...
Hi
And were you logged in as this account when you tested =sp_send_dbmail?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23A5C6DOmIHA.5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account that is an administrator on =the server, which is the same account the SQL Server service is running =under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, =but I am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a =specific private profile. Of note is that the button to "Test" the mail =profile is grayed out on the Alert System tab. When I execute =sp_send_dbmail using the e-mail address from the operator and use the =profile name defined in the SQL Agent properties, I receive an e-mail. =However the jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the =sysmail_profile table. The e-mail does not appear in sysmail_mailitems =and sysmail_send_retries is empty. So the job notification is not =getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_0019_01C89953.299E61C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

I've just noticed another issue. =I've created all my maintenance plans using the wizard. When I go into the ="Reporting and Logging" section for the maintenance plan, I've selected the "Send =report to an email recipient" check box, the recipient being the same one that the =job alert sends to. However, I am not receiving the e-mail =report. Instead, I am only getting an e-mail from the job saying it has =completed. I don't get a report from the maintenance plan. I have also =confirmed that the logging file is created in a folder on the server.
Any idea why I am not getting this =report in an e-mail?
Thank-you,
Rubens
"Rubens" =wrote in message news:eC7QYMXmIHA.5684=@.TK2MSFTNGP03.phx.gbl...
Yes, I was able to send an e-mail =using T-SQL when logged in with the account the SQL Server service / agent was using. I was able to fix the problem, although I am not sure if =it=92s a permanent solution.

The job operator e-mail address was a = distribution list on Exchange. I changed the e-mail address to include my own, ran the job, and one alert came through =fine. Then I sent it only to my account, again, worked fine. I then retyped =the operator e-mail address back in of the distribution list and it succeeded. The one thing I am positive of is that the e-mail =address was correct right from the start because I use the same e-mail address in =the Pagers section. This was and is identical to what was in the =E-mail name of the operator.

Does this sound like a bug? I =guess it=92s a little concerning considering one of the benefits of database mail is =it being SMTP based and supposed to be a lot more reliable.

Thanks,
Rubens
"Rubens" =wrote in message news:e1A60tPmIHA.2268=@.TK2MSFTNGP02.phx.gbl...
Hmmm, come to think of it, no I =wasn't. I will have to test that when back in the office tomorrow. I =will let you know.

Thanks John.

Rubens
"John Bell" wrote in message news:erH9oGOmIHA.1184=@.TK2MSFTNGP04.phx.gbl...
Hi

And were you logged in as this =account when you tested sp_send_dbmail?

John
"Rubens" wrote in message news:%23A5C6DOmIHA.=5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain =account that is an administrator on the server, which is the same account the =SQL Server service is running under (I haven't split them up and =restricted it as is recommended).

Thank-you,
Rubens
"John Bell" wrote in message news:O6%231lsNmIHA.=1208@.TK2MSFTNGP05.phx.gbl...
Hi

What account is SQL Agent =running under?

John
"Rubens" wrote in message news:%23Tec6mLmIHA.=3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured =to e-mail myself on completion, but I am not currently receiving =these notifications.

The SQL Agent is configured =to use database mail, with a specific private profile. Of =note is that the button to "Test" the mail profile is grayed out on =the Alert System tab. When I execute sp_send_dbmail using =the e-mail address from the operator and use the profile name =defined in the SQL Agent properties, I receive an e-mail. However =the jobs themselves are not sending me any e-mail.

I've also confirmed the =correct name of the profile in the sysmail_profile table. The e-mail =does not appear in sysmail_mailitems and sysmail_send_retries is =empty. So the job notification is not getting queued.

Any ideas?

Thank-you,
Rubens

--=_NextPart_000_0019_01C89953.299E61C0--

Database mail not sending

I am using the sp_send_dbmail sp and all appears to go well with that. But SS does not seem to be attempting to send the mail.

However when I look at the entries in sysmail_mailitems the sent status is zero. There are no entries in sysmail_log.

I configured Database Mail via the wizard. I am using the Sept CTP.

What could be the problem?I do have the following information in my Sql Alert log:
Unable to start mail session [reason: No Mail Profile defined]

However there are two mail methods defined in 2005, Sql Mail and Database Mail. I have defined a default mail profile in Database Mail. I have define and test one in Sql Mail and it says it works.

Database mail issue - any ideas?

We recently installed 2005 and have been playing with it. I seem to be
having a problem with Database Mail as it relates to job notifications,
and wanted to see if anyone knew what I was doing wrong or how to fix
this issue.
We've enabled Database Mail using the SAC tool. I've set up a mail
profile & account successfully and sent successful test messages. I
followed the instructions here (
http://msdn2.microsoft.com/en-us/library/ms186358.aspx ) on configuring
SQL Agent mail to use my Database Mail profile. But alas - no messages
ever arrive. In the SQL Agent log, I see this:
Message
[264] An attempt was made to send an email when no email session has
been established
Everything seemed rather straightforward....am I doing something wrong?
Did you run msdb.dbo.sysmail_start_sp? Try
msdb.dbo.sysmail_help_status_sp and see what the result is.
-KJ
|||The result was...
STARTED
|||You may need to define an operator.
|||I also defined an operator (myself). The operator email has the same
email address as the test message that was sent successfully, so I know
everything outside of SQL is working (SMTP relay, etc.).
|||OK - got it figured out. I just had to stop & restart the service,
which I did through SAC tool. Then I immediately received my next test
from the job.

Database mail issue - any ideas?

We recently installed 2005 and have been playing with it. I seem to be
having a problem with Database Mail as it relates to job notifications,
and wanted to see if anyone knew what I was doing wrong or how to fix
this issue.
We've enabled Database Mail using the SAC tool. I've set up a mail
profile & account successfully and sent successful test messages. I
followed the instructions here (
http://msdn2.microsoft.com/en-us/library/ms186358.aspx ) on configuring
SQL Agent mail to use my Database Mail profile. But alas - no messages
ever arrive. In the SQL Agent log, I see this:
Message
[264] An attempt was made to send an email when no email session has
been established
Everything seemed rather straightforward....am I doing something wrong?Did you run msdb.dbo.sysmail_start_sp? Try
msdb.dbo.sysmail_help_status_sp and see what the result is.
-KJ|||The result was...
STARTED|||You may need to define an operator.|||I also defined an operator (myself). The operator email has the same
email address as the test message that was sent successfully, so I know
everything outside of SQL is working (SMTP relay, etc.).|||OK - got it figured out. I just had to stop & restart the service,
which I did through SAC tool. Then I immediately received my next test
from the job.

Database mail issue - any ideas?

We recently installed 2005 and have been playing with it. I seem to be
having a problem with Database Mail as it relates to job notifications,
and wanted to see if anyone knew what I was doing wrong or how to fix
this issue.
We've enabled Database Mail using the SAC tool. I've set up a mail
profile & account successfully and sent successful test messages. I
followed the instructions here (
http://msdn2.microsoft.com/en-us/library/ms186358.aspx ) on configuring
SQL Agent mail to use my Database Mail profile. But alas - no messages
ever arrive. In the SQL Agent log, I see this:
Message
[264] An attempt was made to send an email when no email session has
been established
Everything seemed rather straightforward....am I doing something wrong?Did you run msdb.dbo.sysmail_start_sp? Try
msdb.dbo.sysmail_help_status_sp and see what the result is.
-KJ|||The result was...
STARTED|||You may need to define an operator.|||I also defined an operator (myself). The operator email has the same
email address as the test message that was sent successfully, so I know
everything outside of SQL is working (SMTP relay, etc.).|||OK - got it figured out. I just had to stop & restart the service,
which I did through SAC tool. Then I immediately received my next test
from the job.