Saturday, February 25, 2012

Database Mail: getting bounce info from Exchange?

Database Mail only sends SMTP email messages and logs problems
connecting to the mail server. However, I also need to log bounced
emails (bad address, etc).

Are there any clean ways to do this with Database Mail and Exchange?
Or will I have to mix Database Mail with SQL Mail to read bounces out
of the inbox? Or, have a .NET windows service that talks to the
Exchange API?"Manny Klystron" <manny.klystron@.gmail.comwrote in message
news:1177542209.460490.41620@.t39g2000prd.googlegro ups.com...

Quote:

Originally Posted by

Database Mail only sends SMTP email messages and logs problems
connecting to the mail server. However, I also need to log bounced
emails (bad address, etc).
>
Are there any clean ways to do this with Database Mail and Exchange?
Or will I have to mix Database Mail with SQL Mail to read bounces out
of the inbox? Or, have a .NET windows service that talks to the
Exchange API?


I'd have a separate API that handles this. It's not really a good duty for
SQL Server.

Quote:

Originally Posted by

>


--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

Database Mail: getting bounce info from Exchange?

Database Mail only sends SMTP email messages and logs problems
connecting to the mail server. However, I also need to log bounced
emails (bad address, etc).
Are there any clean ways to do this with Database Mail and Exchange?
Or will I have to mix Database Mail with SQL Mail to read bounces out
of the inbox? Or, have a .NET windows service that talks to the
Exchange API?
"Manny Klystron" <manny.klystron@.gmail.com> wrote in message
news:1177542209.460490.41620@.t39g2000prd.googlegro ups.com...
> Database Mail only sends SMTP email messages and logs problems
> connecting to the mail server. However, I also need to log bounced
> emails (bad address, etc).
> Are there any clean ways to do this with Database Mail and Exchange?
> Or will I have to mix Database Mail with SQL Mail to read bounces out
> of the inbox? Or, have a .NET windows service that talks to the
> Exchange API?
I'd have a separate API that handles this. It's not really a good duty for
SQL Server.

>
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

Database Mail: getting bounce info from Exchange?

Database Mail only sends SMTP email messages and logs problems
connecting to the mail server. However, I also need to log bounced
emails (bad address, etc).
Are there any clean ways to do this with Database Mail and Exchange?
Or will I have to mix Database Mail with SQL Mail to read bounces out
of the inbox? Or, have a .NET windows service that talks to the
Exchange API?"Manny Klystron" <manny.klystron@.gmail.com> wrote in message
news:1177542209.460490.41620@.t39g2000prd.googlegroups.com...
> Database Mail only sends SMTP email messages and logs problems
> connecting to the mail server. However, I also need to log bounced
> emails (bad address, etc).
> Are there any clean ways to do this with Database Mail and Exchange?
> Or will I have to mix Database Mail with SQL Mail to read bounces out
> of the inbox? Or, have a .NET windows service that talks to the
> Exchange API?
I'd have a separate API that handles this. It's not really a good duty for
SQL Server.
>
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

Database Mail: getting bounce info from Exchange?

Database Mail only sends SMTP email messages and logs problems
connecting to the mail server. However, I also need to log bounced
emails (bad address, etc).
Are there any clean ways to do this with Database Mail and Exchange?
Or will I have to mix Database Mail with SQL Mail to read bounces out
of the inbox? Or, have a .NET windows service that talks to the
Exchange API?"Manny Klystron" <manny.klystron@.gmail.com> wrote in message
news:1177542209.460490.41620@.t39g2000prd.googlegroups.com...
> Database Mail only sends SMTP email messages and logs problems
> connecting to the mail server. However, I also need to log bounced
> emails (bad address, etc).
> Are there any clean ways to do this with Database Mail and Exchange?
> Or will I have to mix Database Mail with SQL Mail to read bounces out
> of the inbox? Or, have a .NET windows service that talks to the
> Exchange API?
I'd have a separate API that handles this. It's not really a good duty for
SQL Server.

>
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

database mail XPs

hello
i want to know the meaning of XPs?
thank you
Extended Stored Procedure. Something writem in a compiled language that
creates a .dll file that you must register in SQL Server before you can use
it.
"test windows" <testwindows@.discussions.microsoft.com> wrote in message
news:48A67541-5B92-4207-A1A8-9C89E499F4E8@.microsoft.com...
> hello
> i want to know the meaning of XPs?
> thank you

database mail XPs

hello
i want to know the meaning of XPs'
thank youExtended Stored Procedure. Something writem in a compiled language that
creates a .dll file that you must register in SQL Server before you can use
it.
"test windows" <testwindows@.discussions.microsoft.com> wrote in message
news:48A67541-5B92-4207-A1A8-9C89E499F4E8@.microsoft.com...
> hello
> i want to know the meaning of XPs'
> thank you

database mail XPs

hello
i want to know the meaning of XPs'
thank youExtended Stored Procedure. Something writem in a compiled language that
creates a .dll file that you must register in SQL Server before you can use
it.
"test windows" <testwindows@.discussions.microsoft.com> wrote in message
news:48A67541-5B92-4207-A1A8-9C89E499F4E8@.microsoft.com...
> hello
> i want to know the meaning of XPs'
> thank you

Database Mail Works Locally but not from Web

I'm building a web site in Visual Web Developer Express on a SQL Server 2005 Developer Edition database, on XP Pro with IIS 5.1 up and running.

Database Mail is configured and works well from the VWD environment. I can launch the site locally from VWD and the stored procedures that call the database mail functions execute perfectly.

However, when I copy the site from the development folder under VWD to my IIS default web page, nothing is ever generated from database mail. I can open the site in IIS and everything looks like it's responding correctly (data updates, refreshes etc) but the behind-the-scenes processes that should be generating email traffic don't do anything.

Review of the database mail log through SQL Server Management Studio shows no activity at all during the timeframe of the "on line" IIS sessions, so it appears that the process isn't hearing anything calling it (or is ignoring the calls if they are happening).

Why would it work in one environment and not another on the same machine? Is there a setup configuration or permissions issue that I've missed somewhere?

Thanks in advance.

I suggest it is a permissions thing. I suggest this is asked in the development forums, in how to conifgure your website to talk to your database with the correct permissions.|||

You were correct, the sp_send_dbmail SPROC used by my stored procedure resides in the MSDB database. The default configuration does not include the ASPNET account with any permissions. Once I found the SPROC and granted Execute permission to ASPNET, everything started working as intended. It's magic!

database mail Vs. xp_smtp_sendmail

Hi,
we are in the process of upgrading SQL Server 2000 to 2005,
Now, a lot of emails are sent within stored procedures using
xp_smtp_sendmail.
Now this procedure is quite nice because it lets the caller
define diffrent From names and ReplyTo depending on certain conditions.
Since I can't reuse this procedure in SQL 2005, I am testing the
Database Mail using the sp_send_dbmail stored procedure along with
some profiles I created. It works great, but...
My problem here is that sp_send_dbmail doesn't let you dynamically change
the FROM and REPLYTO parameters, it uses the ones on the profile
sp_send_dbmail
recieves in parameter. This leaves me with a dilemna because the from and
replyTo
adresses possibility are too great (that is why it was made dynamic in our
SQL 2000 using xp_smtp_sendmail)
How should I proceed if I do not want to create 1 profile per possibility?
Is there another way or another SMTP send mail procedure or technique I
could use in SQL 2005
that will allow me to do the same thing as in XP_smtp_SendMail ?
Ideas anyone ?
Thanks
> Since I can't reuse this procedure in SQL 2005
Why not? As long as you are on 32-bit, you can install the DLL on 2005 the
same way you did on 2000.
A
|||Thanks, But it is a x64 bit SQL Server..
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%230invczaHHA.960@.TK2MSFTNGP03.phx.gbl...
> You should be able to use xp_smtp in 2005, as long as it is 32 bit SQL
> Server.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "msnews.microsoft.com" <spam@.spam.com> wrote in message
> news:e8h4gUzaHHA.5020@.TK2MSFTNGP05.phx.gbl...
>
|||> Thanks, But it is a x64 bit SQL Server..
In that case, you could learn the format and write a stored procedure that
creates a properly-formatted text file with a .msg extension and drops it
into the pickup folder of a local SMTP server (which doesn't necessarily
have to live on the same server, so could be 32-bit). This would allow you
to have full control over FROM/REPLYTO etc.
Another option is to set up a 32-bit edition of Express or Workgroup on
another server (even a web server), and route messages through it. As long
as the network path is reliable, not a huge difference between 'EXEC
master.dbo.xp_smtp_sendmail' and 'EXEC
linked_server_name.master.dbo.xp_smtp_sendmail'...
A
|||BTW, I submitted an enhancement request about this issue. You can vote on
it if you have a passport and feel strongly enough about it to have it
addressed in a future version of SQL Server:
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=264498
A

database mail Vs. xp_smtp_sendmail

Hi,
we are in the process of upgrading SQL Server 2000 to 2005,
Now, a lot of emails are sent within stored procedures using
xp_smtp_sendmail.
Now this procedure is quite nice because it lets the caller
define diffrent From names and ReplyTo depending on certain conditions.
Since I can't reuse this procedure in SQL 2005, I am testing the
Database Mail using the sp_send_dbmail stored procedure along with
some profiles I created. It works great, but...
My problem here is that sp_send_dbmail doesn't let you dynamically change
the FROM and REPLYTO parameters, it uses the ones on the profile
sp_send_dbmail
recieves in parameter. This leaves me with a dilemna because the from and
replyTo
adresses possibility are too great (that is why it was made dynamic in our
SQL 2000 using xp_smtp_sendmail)
How should I proceed if I do not want to create 1 profile per possibility?
Is there another way or another SMTP send mail procedure or technique I
could use in SQL 2005
that will allow me to do the same thing as in XP_smtp_SendMail ?
Ideas anyone ?
Thanks> Since I can't reuse this procedure in SQL 2005
Why not? As long as you are on 32-bit, you can install the DLL on 2005 the
same way you did on 2000.
A|||> Since I can't reuse this procedure in SQL 2005, I am testing the
You should be able to use xp_smtp in 2005, as long as it is 32 bit SQL Serve
r.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"msnews.microsoft.com" <spam@.spam.com> wrote in message
news:e8h4gUzaHHA.5020@.TK2MSFTNGP05.phx.gbl...
> Hi,
> we are in the process of upgrading SQL Server 2000 to 2005,
> Now, a lot of emails are sent within stored procedures using
> xp_smtp_sendmail.
> Now this procedure is quite nice because it lets the caller
> define diffrent From names and ReplyTo depending on certain conditions.
>
> Since I can't reuse this procedure in SQL 2005, I am testing the
> Database Mail using the sp_send_dbmail stored procedure along with
> some profiles I created. It works great, but...
>
> My problem here is that sp_send_dbmail doesn't let you dynamically change
> the FROM and REPLYTO parameters, it uses the ones on the profile
> sp_send_dbmail
> recieves in parameter. This leaves me with a dilemna because the from and
> replyTo
> adresses possibility are too great (that is why it was made dynamic in our
> SQL 2000 using xp_smtp_sendmail)
>
> How should I proceed if I do not want to create 1 profile per possibility?
> Is there another way or another SMTP send mail procedure or technique I
> could use in SQL 2005
> that will allow me to do the same thing as in XP_smtp_SendMail ?
>
> Ideas anyone ?
>
> Thanks
>
>|||Thanks, But it is a x64 bit SQL Server..
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%230invczaHHA.960@.TK2MSFTNGP03.phx.gbl...
> You should be able to use xp_smtp in 2005, as long as it is 32 bit SQL
> Server.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "msnews.microsoft.com" <spam@.spam.com> wrote in message
> news:e8h4gUzaHHA.5020@.TK2MSFTNGP05.phx.gbl...
>|||> Thanks, But it is a x64 bit SQL Server..
Well, you can't use a 32 bit DLL in 64 bit code. See Russell's reply to Fred
's post for suggestion.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"msnews.microsoft.com" <spam@.spam.com> wrote in message
news:euuEqS8aHHA.1508@.TK2MSFTNGP06.phx.gbl...
> Thanks, But it is a x64 bit SQL Server..
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:%230invczaHHA.960@.TK2MSFTNGP03.phx.gbl...
>|||> Thanks, But it is a x64 bit SQL Server..
In that case, you could learn the format and write a stored procedure that
creates a properly-formatted text file with a .msg extension and drops it
into the pickup folder of a local SMTP server (which doesn't necessarily
have to live on the same server, so could be 32-bit). This would allow you
to have full control over FROM/REPLYTO etc.
Another option is to set up a 32-bit edition of Express or Workgroup on
another server (even a web server), and route messages through it. As long
as the network path is reliable, not a huge difference between 'EXEC
master.dbo.xp_smtp_sendmail' and 'EXEC
linked_server_name.master.dbo.xp_smtp_sendmail'...
A|||BTW, I submitted an enhancement request about this issue. You can vote on
it if you have a passport and feel strongly enough about it to have it
addressed in a future version of SQL Server:
https://connect.microsoft.com/SQLSe...=2644
98
A

database mail Vs. xp_smtp_sendmail

Hi,
we are in the process of upgrading SQL Server 2000 to 2005,
Now, a lot of emails are sent within stored procedures using
xp_smtp_sendmail.
Now this procedure is quite nice because it lets the caller
define diffrent From names and ReplyTo depending on certain conditions.
Since I can't reuse this procedure in SQL 2005, I am testing the
Database Mail using the sp_send_dbmail stored procedure along with
some profiles I created. It works great, but...
My problem here is that sp_send_dbmail doesn't let you dynamically change
the FROM and REPLYTO parameters, it uses the ones on the profile
sp_send_dbmail
recieves in parameter. This leaves me with a dilemna because the from and
replyTo
adresses possibility are too great (that is why it was made dynamic in our
SQL 2000 using xp_smtp_sendmail)
How should I proceed if I do not want to create 1 profile per possibility?
Is there another way or another SMTP send mail procedure or technique I
could use in SQL 2005
that will allow me to do the same thing as in XP_smtp_SendMail ?
Ideas anyone ?
Thanks> Since I can't reuse this procedure in SQL 2005
Why not? As long as you are on 32-bit, you can install the DLL on 2005 the
same way you did on 2000.
A|||> Since I can't reuse this procedure in SQL 2005, I am testing the
You should be able to use xp_smtp in 2005, as long as it is 32 bit SQL Server.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"msnews.microsoft.com" <spam@.spam.com> wrote in message
news:e8h4gUzaHHA.5020@.TK2MSFTNGP05.phx.gbl...
> Hi,
> we are in the process of upgrading SQL Server 2000 to 2005,
> Now, a lot of emails are sent within stored procedures using
> xp_smtp_sendmail.
> Now this procedure is quite nice because it lets the caller
> define diffrent From names and ReplyTo depending on certain conditions.
>
> Since I can't reuse this procedure in SQL 2005, I am testing the
> Database Mail using the sp_send_dbmail stored procedure along with
> some profiles I created. It works great, but...
>
> My problem here is that sp_send_dbmail doesn't let you dynamically change
> the FROM and REPLYTO parameters, it uses the ones on the profile
> sp_send_dbmail
> recieves in parameter. This leaves me with a dilemna because the from and
> replyTo
> adresses possibility are too great (that is why it was made dynamic in our
> SQL 2000 using xp_smtp_sendmail)
>
> How should I proceed if I do not want to create 1 profile per possibility?
> Is there another way or another SMTP send mail procedure or technique I
> could use in SQL 2005
> that will allow me to do the same thing as in XP_smtp_SendMail ?
>
> Ideas anyone ?
>
> Thanks
>
>|||Thanks, But it is a x64 bit SQL Server..
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%230invczaHHA.960@.TK2MSFTNGP03.phx.gbl...
>> Since I can't reuse this procedure in SQL 2005, I am testing the
> You should be able to use xp_smtp in 2005, as long as it is 32 bit SQL
> Server.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "msnews.microsoft.com" <spam@.spam.com> wrote in message
> news:e8h4gUzaHHA.5020@.TK2MSFTNGP05.phx.gbl...
>> Hi,
>> we are in the process of upgrading SQL Server 2000 to 2005,
>> Now, a lot of emails are sent within stored procedures using
>> xp_smtp_sendmail.
>> Now this procedure is quite nice because it lets the caller
>> define diffrent From names and ReplyTo depending on certain conditions.
>>
>> Since I can't reuse this procedure in SQL 2005, I am testing the
>> Database Mail using the sp_send_dbmail stored procedure along with
>> some profiles I created. It works great, but...
>>
>> My problem here is that sp_send_dbmail doesn't let you dynamically change
>> the FROM and REPLYTO parameters, it uses the ones on the profile
>> sp_send_dbmail
>> recieves in parameter. This leaves me with a dilemna because the from
>> and
>> replyTo
>> adresses possibility are too great (that is why it was made dynamic in
>> our
>> SQL 2000 using xp_smtp_sendmail)
>>
>> How should I proceed if I do not want to create 1 profile per
>> possibility?
>> Is there another way or another SMTP send mail procedure or technique I
>> could use in SQL 2005
>> that will allow me to do the same thing as in XP_smtp_SendMail ?
>>
>> Ideas anyone ?
>>
>> Thanks
>>
>>
>|||> Thanks, But it is a x64 bit SQL Server..
Well, you can't use a 32 bit DLL in 64 bit code. See Russell's reply to Fred's post for suggestion.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"msnews.microsoft.com" <spam@.spam.com> wrote in message
news:euuEqS8aHHA.1508@.TK2MSFTNGP06.phx.gbl...
> Thanks, But it is a x64 bit SQL Server..
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:%230invczaHHA.960@.TK2MSFTNGP03.phx.gbl...
>> Since I can't reuse this procedure in SQL 2005, I am testing the
>> You should be able to use xp_smtp in 2005, as long as it is 32 bit SQL Server.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "msnews.microsoft.com" <spam@.spam.com> wrote in message
>> news:e8h4gUzaHHA.5020@.TK2MSFTNGP05.phx.gbl...
>> Hi,
>> we are in the process of upgrading SQL Server 2000 to 2005,
>> Now, a lot of emails are sent within stored procedures using
>> xp_smtp_sendmail.
>> Now this procedure is quite nice because it lets the caller
>> define diffrent From names and ReplyTo depending on certain conditions.
>>
>> Since I can't reuse this procedure in SQL 2005, I am testing the
>> Database Mail using the sp_send_dbmail stored procedure along with
>> some profiles I created. It works great, but...
>>
>> My problem here is that sp_send_dbmail doesn't let you dynamically change
>> the FROM and REPLYTO parameters, it uses the ones on the profile
>> sp_send_dbmail
>> recieves in parameter. This leaves me with a dilemna because the from and
>> replyTo
>> adresses possibility are too great (that is why it was made dynamic in our
>> SQL 2000 using xp_smtp_sendmail)
>>
>> How should I proceed if I do not want to create 1 profile per possibility?
>> Is there another way or another SMTP send mail procedure or technique I
>> could use in SQL 2005
>> that will allow me to do the same thing as in XP_smtp_SendMail ?
>>
>> Ideas anyone ?
>>
>> Thanks
>>
>>
>|||> Thanks, But it is a x64 bit SQL Server..
In that case, you could learn the format and write a stored procedure that
creates a properly-formatted text file with a .msg extension and drops it
into the pickup folder of a local SMTP server (which doesn't necessarily
have to live on the same server, so could be 32-bit). This would allow you
to have full control over FROM/REPLYTO etc.
Another option is to set up a 32-bit edition of Express or Workgroup on
another server (even a web server), and route messages through it. As long
as the network path is reliable, not a huge difference between 'EXEC
master.dbo.xp_smtp_sendmail' and 'EXEC
linked_server_name.master.dbo.xp_smtp_sendmail'...
A|||BTW, I submitted an enhancement request about this issue. You can vote on
it if you have a passport and feel strongly enough about it to have it
addressed in a future version of SQL Server:
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=264498
A

Database Mail vs. SQL Mail

Since SQL Mail is being deprecated, will Database Mail in SQL Server 2008 have the capability of RECEIVING mail? I have several apps which require that functionality.

maghick wrote:

Since SQL Mail is being deprecated


SQL Mail will still be available in SQL Server 2008.

maghick wrote:

will Database Mail in SQL Server 2008 have the capability of RECEIVING mail?


Database Mail will not likely have this in SQL Server 2008.

Paul A. Mestemaker II
Program Manager
Microsoft SQL Server
http://blogs.msdn.com/sqlrem/

database mail to send mail to multiple recipient from table

I am using database mail to send emails to our Lotus Notes SMTP server using sp_send_dbmail. I want to accomplish the following.

I have maintained department-wise users email address in one table . Now I want to send mail to one particular department and there can be 1-15 users as recipient for that mail. How can I do that using sp_send_dbmail?

Well, I have found answer to it. The following way, we can accomplish. Hope that will help those, who are searching for something similar.

DECLARE @.email VARCHAR(4000)
SET @.email = ''
SELECT @.email = RTRIM(@.email) + RTRIM(email) + ';'
FROM Users
WHERE email <> '' AND DepCode = 'A'
PRINT @.email

EXECUTE msdb.dbo.sysmail_add_account_sp
@.account_name = 'custoerders',
@.description = 'Customer Address Account',
@.email_address = @.email
@.mailserver_name = 'mail.anywhere.com'

database mail to send mail to multiple recipient from table

I am using database mail to send emails to our Lotus Notes SMTP server using sp_send_dbmail. I want to accomplish the following.

I have maintained department-wise users email address in one table . Now I want to send mail to one particular department and there can be 1-15 users as recipient for that mail. How can I do that using sp_send_dbmail?

Well, I have found answer to it. The following way, we can accomplish. Hope that will help those, who are searching for something similar.

DECLARE @.email VARCHAR(4000)
SET @.email = ''
SELECT @.email = RTRIM(@.email) + RTRIM(email) + ';'
FROM Users
WHERE email <> '' AND DepCode = 'A'
PRINT @.email

EXECUTE msdb.dbo.sysmail_add_account_sp
@.account_name = 'custoerders',
@.description = 'Customer Address Account',
@.email_address = @.email
@.mailserver_name = 'mail.anywhere.com'

DataBase Mail Test

I have already checked that I can test the "Database Mail" via sending e-mail!

But I would like to ask if this e-mail could be with a digital signature?

If anyone knows the way I can do it,I would like to tell me how I can do it!!!!

Thank you very much

Nikos

I don't think it is possible for the database mail, as the individual third party or outlook based digital signature will not be able to decrypt of check such information. You might need to check on Exchange based forums in this case.

http://aspnet.4guysfromrolla.com/articles/022807-1.aspx fyi and it is only based for data.

Database Mail stops working on SQL 2005

We've encountered a problem on several SQL 2005 installations where
database mail completely stops working for no reason. Has anyone else
encountered this? This only affects calls to sp_send_dbmail and job
alerts, etc. When I right-click DBMail in SSMS and choose Send Test
Email - that one works. But none of the stuff that actually WANT to
work. Any help would be appreciated. No errors anywhere - just the
message never arrives.
Did sp_send_dbmail ever work? Did you enable service broker in the msdb database?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"CoreyB" <unc27932@.yahoo.com> wrote in message
news:1142005500.961901.109950@.j33g2000cwa.googlegr oups.com...
> We've encountered a problem on several SQL 2005 installations where
> database mail completely stops working for no reason. Has anyone else
> encountered this? This only affects calls to sp_send_dbmail and job
> alerts, etc. When I right-click DBMail in SSMS and choose Send Test
> Email - that one works. But none of the stuff that actually WANT to
> work. Any help would be appreciated. No errors anywhere - just the
> message never arrives.
>
|||Yes - we were using sp_send_dbmail in our SPs and they were running
great. Then they just stopped working - or should I say stopped
delivering. The status in the sys tables say that the messages were
sent. I've done the all the checks found on MS troubleshooting
page...
http://msdn2.microsoft.com/en-US/library/ms189959(SQL.90).aspx
This included checking to be sure service broker was enabled, which it
was, and dbmail was started. I'm fairly confident it's not the SMTP
server b/c the manual test in the GUI of SSMS works fine.
|||Can you run these statements and post back the result?
select count(*) from msdb.dbo.InternalMailQueue
select count(*) from msdb.dbo.ExternalMailQueue
select count(*) from msdb.sys.transmission_queue
select distinct transmission_status from msdb.sys.transmission_queue
select sq.name,qm.* from sys.dm_broker_queue_monitors qm
join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
where database_id = db_id('msdb')
This posting is provided "AS IS" with no warranties, and confers no rights.
HTH,
~ Remus Rusanu
SQL Service Broker
http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
"CoreyB" <unc27932@.yahoo.com> wrote in message
news:1142005500.961901.109950@.j33g2000cwa.googlegr oups.com...
> We've encountered a problem on several SQL 2005 installations where
> database mail completely stops working for no reason. Has anyone else
> encountered this? This only affects calls to sp_send_dbmail and job
> alerts, etc. When I right-click DBMail in SSMS and choose Send Test
> Email - that one works. But none of the stuff that actually WANT to
> work. Any help would be appreciated. No errors anywhere - just the
> message never arrives.
>
|||Here are the results of those SQL statements...
select count(*) from msdb.dbo.InternalMailQueue
0
select count(*) from msdb.dbo.ExternalMailQueue
0
select count(*) from msdb.sys.transmission_queue
0
select distinct transmission_status from msdb.sys.transmission_queue
No Rows Returned
select sq.name,qm.* from sys.dm_broker_queue_monitors qm
join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
where database_id = db_id('msdb')
InternalMailQueue4843150049INACTIVE2006-03-10
16:29:19.9972006-03-10 16:29:19.9830
ExternalMailQueue4875150163INACTIVE2006-03-10
16:39:19.9572006-03-10 16:24:42.2430
Remus Rusanu [MSFT] wrote:[vbcol=seagreen]
> Can you run these statements and post back the result?
> select count(*) from msdb.dbo.InternalMailQueue
> select count(*) from msdb.dbo.ExternalMailQueue
> select count(*) from msdb.sys.transmission_queue
> select distinct transmission_status from msdb.sys.transmission_queue
> select sq.name,qm.* from sys.dm_broker_queue_monitors qm
> join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
> where database_id = db_id('msdb')
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> HTH,
> ~ Remus Rusanu
> SQL Service Broker
> http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
>
> "CoreyB" <unc27932@.yahoo.com> wrote in message
> news:1142005500.961901.109950@.j33g2000cwa.googlegr oups.com...
|||I'm still hoping someone might know about this...anyone?
CoreyB wrote:[vbcol=seagreen]
> Here are the results of those SQL statements...
> select count(*) from msdb.dbo.InternalMailQueue
> 0
> select count(*) from msdb.dbo.ExternalMailQueue
> 0
> select count(*) from msdb.sys.transmission_queue
> 0
> select distinct transmission_status from msdb.sys.transmission_queue
> No Rows Returned
>
> select sq.name,qm.* from sys.dm_broker_queue_monitors qm
> join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
> where database_id = db_id('msdb')
> InternalMailQueue4843150049INACTIVE2006-03-10
> 16:29:19.9972006-03-10 16:29:19.9830
> ExternalMailQueue4875150163INACTIVE2006-03-10
> 16:39:19.9572006-03-10 16:24:42.2430
>
> Remus Rusanu [MSFT] wrote:
|||CoreyB,
I had similar symptoms but not identical. Database Mail stopped
working unexpectedly including send test email as well as alerts.
Also, database mail log had no activity since a couple of days ago when
it stopped working. I had 37 messages unsent.
I double-checked the following:
1. database mail enabled via surface configuration
2. proper agent and profiles setup
3. service broker message delivery activated
4. database mail in mail host database started
All looked good so far...
5. messages stuck in queue -- yes, 37 total 6. status of messages in
queue -- status "unsent" which traces back to problem with database
mail configuration or external program not getting called for some
reason.
So I basically navigated to location of databasemail90.exe and
double-clicked to run manually and viola, messages started flowing.
However, CMD window stayed open longer than expected so I closed
abruptly.
After this, Step 4 above, "database mail started" now showed status of
"stopped". I ran a command in SQL studio to restart and now things
worked as expected -- mail flowing without me having to double-click
anything.
In summary, my observation is that the external program,
databasemail90.exe was in a "bad state" and required me to kick start
it manually.
http://msdn2.microsoft.com/en-US/library/ms189959(SQL.90).aspx
Here is relevant SQL obtained from MSDN troubleshooting guides if
anyone is interested:
--check to see if service broker is enabled SELECT is_broker_enabled
FROM sys.databases WHERE name = 'msdb' ;
--check to see if database mail is started in msdb database use msdb go
EXECUTE dbo.sysmail_help_status_sp ;
--start database mail if necessary
EXECUTE dbo.sysmail_start_sp ;
--check status of mail queue
sysmail_help_queue_sp @.queue_type = 'Mail' ;
--check database mail event log
select * from sysmail_event_log
--check database mail queue for status of all items select * from
sysmail_allitems
select * from sysmail_allitems

Database Mail stops working on SQL 2005

We've encountered a problem on several SQL 2005 installations where
database mail completely stops working for no reason. Has anyone else
encountered this? This only affects calls to sp_send_dbmail and job
alerts, etc. When I right-click DBMail in SSMS and choose Send Test
Email - that one works. But none of the stuff that actually WANT to
work. Any help would be appreciated. No errors anywhere - just the
message never arrives.Did sp_send_dbmail ever work? Did you enable service broker in the msdb database?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"CoreyB" <unc27932@.yahoo.com> wrote in message
news:1142005500.961901.109950@.j33g2000cwa.googlegroups.com...
> We've encountered a problem on several SQL 2005 installations where
> database mail completely stops working for no reason. Has anyone else
> encountered this? This only affects calls to sp_send_dbmail and job
> alerts, etc. When I right-click DBMail in SSMS and choose Send Test
> Email - that one works. But none of the stuff that actually WANT to
> work. Any help would be appreciated. No errors anywhere - just the
> message never arrives.
>|||Yes - we were using sp_send_dbmail in our SPs and they were running
great. Then they just stopped working - or should I say stopped
delivering. The status in the sys tables say that the messages were
sent. I've done the all the checks found on MS troubleshooting
page...
http://msdn2.microsoft.com/en-US/library/ms189959(SQL.90).aspx
This included checking to be sure service broker was enabled, which it
was, and dbmail was started. I'm fairly confident it's not the SMTP
server b/c the manual test in the GUI of SSMS works fine.|||Can you run these statements and post back the result?
select count(*) from msdb.dbo.InternalMailQueue
select count(*) from msdb.dbo.ExternalMailQueue
select count(*) from msdb.sys.transmission_queue
select distinct transmission_status from msdb.sys.transmission_queue
select sq.name,qm.* from sys.dm_broker_queue_monitors qm
join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
where database_id = db_id('msdb')
--
This posting is provided "AS IS" with no warranties, and confers no rights.
HTH,
~ Remus Rusanu
SQL Service Broker
http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
"CoreyB" <unc27932@.yahoo.com> wrote in message
news:1142005500.961901.109950@.j33g2000cwa.googlegroups.com...
> We've encountered a problem on several SQL 2005 installations where
> database mail completely stops working for no reason. Has anyone else
> encountered this? This only affects calls to sp_send_dbmail and job
> alerts, etc. When I right-click DBMail in SSMS and choose Send Test
> Email - that one works. But none of the stuff that actually WANT to
> work. Any help would be appreciated. No errors anywhere - just the
> message never arrives.
>|||Here are the results of those SQL statements...
select count(*) from msdb.dbo.InternalMailQueue
0
select count(*) from msdb.dbo.ExternalMailQueue
0
select count(*) from msdb.sys.transmission_queue
0
select distinct transmission_status from msdb.sys.transmission_queue
No Rows Returned
select sq.name,qm.* from sys.dm_broker_queue_monitors qm
join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
where database_id = db_id('msdb')
InternalMailQueue 4 843150049 INACTIVE 2006-03-10
16:29:19.997 2006-03-10 16:29:19.983 0
ExternalMailQueue 4 875150163 INACTIVE 2006-03-10
16:39:19.957 2006-03-10 16:24:42.243 0
Remus Rusanu [MSFT] wrote:
> Can you run these statements and post back the result?
> select count(*) from msdb.dbo.InternalMailQueue
> select count(*) from msdb.dbo.ExternalMailQueue
> select count(*) from msdb.sys.transmission_queue
> select distinct transmission_status from msdb.sys.transmission_queue
> select sq.name,qm.* from sys.dm_broker_queue_monitors qm
> join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
> where database_id = db_id('msdb')
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> HTH,
> ~ Remus Rusanu
> SQL Service Broker
> http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
>
> "CoreyB" <unc27932@.yahoo.com> wrote in message
> news:1142005500.961901.109950@.j33g2000cwa.googlegroups.com...
> > We've encountered a problem on several SQL 2005 installations where
> > database mail completely stops working for no reason. Has anyone else
> > encountered this? This only affects calls to sp_send_dbmail and job
> > alerts, etc. When I right-click DBMail in SSMS and choose Send Test
> > Email - that one works. But none of the stuff that actually WANT to
> > work. Any help would be appreciated. No errors anywhere - just the
> > message never arrives.
> >|||I'm still hoping someone might know about this...anyone'
CoreyB wrote:
> Here are the results of those SQL statements...
> select count(*) from msdb.dbo.InternalMailQueue
> 0
> select count(*) from msdb.dbo.ExternalMailQueue
> 0
> select count(*) from msdb.sys.transmission_queue
> 0
> select distinct transmission_status from msdb.sys.transmission_queue
> No Rows Returned
>
> select sq.name,qm.* from sys.dm_broker_queue_monitors qm
> join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
> where database_id = db_id('msdb')
> InternalMailQueue 4 843150049 INACTIVE 2006-03-10
> 16:29:19.997 2006-03-10 16:29:19.983 0
> ExternalMailQueue 4 875150163 INACTIVE 2006-03-10
> 16:39:19.957 2006-03-10 16:24:42.243 0
>
> Remus Rusanu [MSFT] wrote:
> > Can you run these statements and post back the result?
> >
> > select count(*) from msdb.dbo.InternalMailQueue
> > select count(*) from msdb.dbo.ExternalMailQueue
> > select count(*) from msdb.sys.transmission_queue
> > select distinct transmission_status from msdb.sys.transmission_queue
> >
> > select sq.name,qm.* from sys.dm_broker_queue_monitors qm
> > join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
> > where database_id = db_id('msdb')
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> > HTH,
> > ~ Remus Rusanu
> >
> > SQL Service Broker
> > http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
> >
> >
> > "CoreyB" <unc27932@.yahoo.com> wrote in message
> > news:1142005500.961901.109950@.j33g2000cwa.googlegroups.com...
> > > We've encountered a problem on several SQL 2005 installations where
> > > database mail completely stops working for no reason. Has anyone else
> > > encountered this? This only affects calls to sp_send_dbmail and job
> > > alerts, etc. When I right-click DBMail in SSMS and choose Send Test
> > > Email - that one works. But none of the stuff that actually WANT to
> > > work. Any help would be appreciated. No errors anywhere - just the
> > > message never arrives.
> > >|||CoreyB,
I had similar symptoms but not identical. Database Mail stopped
working unexpectedly including send test email as well as alerts.
Also, database mail log had no activity since a couple of days ago when
it stopped working. I had 37 messages unsent.
I double-checked the following:
1. database mail enabled via surface configuration
2. proper agent and profiles setup
3. service broker message delivery activated
4. database mail in mail host database started
All looked good so far...
5. messages stuck in queue -- yes, 37 total 6. status of messages in
queue -- status "unsent" which traces back to problem with database
mail configuration or external program not getting called for some
reason.
So I basically navigated to location of databasemail90.exe and
double-clicked to run manually and viola, messages started flowing.
However, CMD window stayed open longer than expected so I closed
abruptly.
After this, Step 4 above, "database mail started" now showed status of
"stopped". I ran a command in SQL studio to restart and now things
worked as expected -- mail flowing without me having to double-click
anything.
In summary, my observation is that the external program,
databasemail90.exe was in a "bad state" and required me to kick start
it manually.
http://msdn2.microsoft.com/en-US/library/ms189959(SQL.90).aspx
Here is relevant SQL obtained from MSDN troubleshooting guides if
anyone is interested:
--check to see if service broker is enabled SELECT is_broker_enabled
FROM sys.databases WHERE name = 'msdb' ;
--check to see if database mail is started in msdb database use msdb go
EXECUTE dbo.sysmail_help_status_sp ;
--start database mail if necessary
EXECUTE dbo.sysmail_start_sp ;
--check status of mail queue
sysmail_help_queue_sp @.queue_type = 'Mail' ;
--check database mail event log
select * from sysmail_event_log
--check database mail queue for status of all items select * from
sysmail_allitems
select * from sysmail_allitems

Database Mail stops working on SQL 2005

We've encountered a problem on several SQL 2005 installations where
database mail completely stops working for no reason. Has anyone else
encountered this? This only affects calls to sp_send_dbmail and job
alerts, etc. When I right-click DBMail in SSMS and choose Send Test
Email - that one works. But none of the stuff that actually WANT to
work. Any help would be appreciated. No errors anywhere - just the
message never arrives.Did sp_send_dbmail ever work? Did you enable service broker in the msdb data
base?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"CoreyB" <unc27932@.yahoo.com> wrote in message
news:1142005500.961901.109950@.j33g2000cwa.googlegroups.com...
> We've encountered a problem on several SQL 2005 installations where
> database mail completely stops working for no reason. Has anyone else
> encountered this? This only affects calls to sp_send_dbmail and job
> alerts, etc. When I right-click DBMail in SSMS and choose Send Test
> Email - that one works. But none of the stuff that actually WANT to
> work. Any help would be appreciated. No errors anywhere - just the
> message never arrives.
>|||Yes - we were using sp_send_dbmail in our SPs and they were running
great. Then they just stopped working - or should I say stopped
delivering. The status in the sys tables say that the messages were
sent. I've done the all the checks found on MS troubleshooting
page...
http://msdn2.microsoft.com/en-US/library/ms189959(SQL.90).aspx
This included checking to be sure service broker was enabled, which it
was, and dbmail was started. I'm fairly confident it's not the SMTP
server b/c the manual test in the GUI of SSMS works fine.|||Can you run these statements and post back the result?
select count(*) from msdb.dbo.InternalMailQueue
select count(*) from msdb.dbo.ExternalMailQueue
select count(*) from msdb.sys.transmission_queue
select distinct transmission_status from msdb.sys.transmission_queue
select sq.name,qm.* from sys.dm_broker_queue_monitors qm
join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
where database_id = db_id('msdb')
This posting is provided "AS IS" with no warranties, and confers no rights.
HTH,
~ Remus Rusanu
SQL Service Broker
http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
"CoreyB" <unc27932@.yahoo.com> wrote in message
news:1142005500.961901.109950@.j33g2000cwa.googlegroups.com...
> We've encountered a problem on several SQL 2005 installations where
> database mail completely stops working for no reason. Has anyone else
> encountered this? This only affects calls to sp_send_dbmail and job
> alerts, etc. When I right-click DBMail in SSMS and choose Send Test
> Email - that one works. But none of the stuff that actually WANT to
> work. Any help would be appreciated. No errors anywhere - just the
> message never arrives.
>|||Here are the results of those SQL statements...
select count(*) from msdb.dbo.InternalMailQueue
0
select count(*) from msdb.dbo.ExternalMailQueue
0
select count(*) from msdb.sys.transmission_queue
0
select distinct transmission_status from msdb.sys.transmission_queue
No Rows Returned
select sq.name,qm.* from sys.dm_broker_queue_monitors qm
join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
where database_id = db_id('msdb')
InternalMailQueue 4 843150049 INACTIVE 2
006-03-10
16:29:19.997 2006-03-10 16:29:19.983 0
ExternalMailQueue 4 875150163 INACTIVE 2
006-03-10
16:39:19.957 2006-03-10 16:24:42.243 0
Remus Rusanu [MSFT] wrote:[vbcol=seagreen]
> Can you run these statements and post back the result?
> select count(*) from msdb.dbo.InternalMailQueue
> select count(*) from msdb.dbo.ExternalMailQueue
> select count(*) from msdb.sys.transmission_queue
> select distinct transmission_status from msdb.sys.transmission_queue
> select sq.name,qm.* from sys.dm_broker_queue_monitors qm
> join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
> where database_id = db_id('msdb')
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> HTH,
> ~ Remus Rusanu
> SQL Service Broker
> http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
>
> "CoreyB" <unc27932@.yahoo.com> wrote in message
> news:1142005500.961901.109950@.j33g2000cwa.googlegroups.com...|||I'm still hoping someone might know about this...anyone'
CoreyB wrote:[vbcol=seagreen]
> Here are the results of those SQL statements...
> select count(*) from msdb.dbo.InternalMailQueue
> 0
> select count(*) from msdb.dbo.ExternalMailQueue
> 0
> select count(*) from msdb.sys.transmission_queue
> 0
> select distinct transmission_status from msdb.sys.transmission_queue
> No Rows Returned
>
> select sq.name,qm.* from sys.dm_broker_queue_monitors qm
> join msdb.sys.service_queues sq on qm.queue_id = sq.object_id
> where database_id = db_id('msdb')
> InternalMailQueue 4 843150049 INACTIVE 2
006-03-10
> 16:29:19.997 2006-03-10 16:29:19.983 0
> ExternalMailQueue 4 875150163 INACTIVE 2
006-03-10
> 16:39:19.957 2006-03-10 16:24:42.243 0
>
> Remus Rusanu [MSFT] wrote:|||CoreyB,
I had similar symptoms but not identical. Database Mail stopped
working unexpectedly including send test email as well as alerts.
Also, database mail log had no activity since a couple of days ago when
it stopped working. I had 37 messages unsent.
I double-checked the following:
1. database mail enabled via surface configuration
2. proper agent and profiles setup
3. service broker message delivery activated
4. database mail in mail host database started
All looked good so far...
5. messages stuck in queue -- yes, 37 total 6. status of messages in
queue -- status "unsent" which traces back to problem with database
mail configuration or external program not getting called for some
reason.
So I basically navigated to location of databasemail90.exe and
double-clicked to run manually and viola, messages started flowing.
However, CMD window stayed open longer than expected so I closed
abruptly.
After this, Step 4 above, "database mail started" now showed status of
"stopped". I ran a command in SQL studio to restart and now things
worked as expected -- mail flowing without me having to double-click
anything.
In summary, my observation is that the external program,
databasemail90.exe was in a "bad state" and required me to kick start
it manually.
http://msdn2.microsoft.com/en-US/library/ms189959(SQL.90).aspx
Here is relevant SQL obtained from MSDN troubleshooting guides if
anyone is interested:
--check to see if service broker is enabled SELECT is_broker_enabled
FROM sys.databases WHERE name = 'msdb' ;
--check to see if database mail is started in msdb database use msdb go
EXECUTE dbo.sysmail_help_status_sp ;
--start database mail if necessary
EXECUTE dbo.sysmail_start_sp ;
--check status of mail queue
sysmail_help_queue_sp @.queue_type = 'Mail' ;
--check database mail event log
select * from sysmail_event_log
--check database mail queue for status of all items select * from
sysmail_allitems
select * from sysmail_allitems

Database Mail SQL 2005

I'm having a problem with database mail in SQL Server 2005. I have set up a default profile. My SMTP server is not a localhost instead i've fed SMTP ip address and port no. The same setting in Outlook express works fine for Incoming and outgoing mails. but in SQL 2005 i'm not able to send test emails. The following errors show up in the sql server agent log

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2006-06-13T10:47:27). Exception Message: Could not connect to mail server. (An established connection was aborted by the software in your host machine).
)

Please help me out....

I have the same problem,

Help please!!!!!!

|||What about testing the sending of Emails using telnet ?

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||yea, got the same problem. We need help with this issue and not a direction to telnet. Thanks|||Yes, sure but telnet will help you to see which error the SMTP server is throwing back during the sending of the message. I don′t want to instruct you using telnet, but thats often the best way to debug the communication.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||i've got the same problem on 64-bit version.
but outlook has sent the e-mails from this computer.

i cannot find in internet some clarifying answer about this problem
|||GUYS!!!!!!

It WORK!!!

See:

Database Mail in SQL Server 2005
www.databasejournal.com/features/mssql/article.php/3626056
|||

hii

sending mail is worked. now i need to send the mail to multirecipients from a table. how could we do that? thank you very much

|||

Hi,

I would use something like this:

use adventureworks

Declare @.Recipients varchar(4000)

select @.Recipients = coalesce(@.Recipients + ';' , '' ) + emailAddress

FROM Person.Contact

PRINT @.Recipients

The results:

a0@.adventure-works.com;a1@.adventure-works.com;aaron0@.adventure-works.com;aaron1@.adventure-works.com;aaron10@.adventure-works.com

|||you're perfect Wink|||Drat - that didn't fix it for me, I still get:

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 5 (2007-06-12T10:46:15). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
)

Outlook express can send fine. I am trying to use a gmail account configured using these settings:

Database Mail SQL 2005

I'm having a problem with database mail in SQL Server 2005. I have set up a default profile. My SMTP server is not a localhost instead i've fed SMTP ip address and port no. The same setting in Outlook express works fine for Incoming and outgoing mails. but in SQL 2005 i'm not able to send test emails. The following errors show up in the sql server agent log

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2006-06-13T10:47:27). Exception Message: Could not connect to mail server. (An established connection was aborted by the software in your host machine).
)

Please help me out....

I have the same problem,

Help please!!!!!!

|||What about testing the sending of Emails using telnet ?

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||yea, got the same problem. We need help with this issue and not a direction to telnet. Thanks|||Yes, sure but telnet will help you to see which error the SMTP server is throwing back during the sending of the message. I don′t want to instruct you using telnet, but thats often the best way to debug the communication.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||i've got the same problem on 64-bit version.
but outlook has sent the e-mails from this computer.

i cannot find in internet some clarifying answer about this problem
|||GUYS!!!!!!

It WORK!!!

See:

Database Mail in SQL Server 2005
www.databasejournal.com/features/mssql/article.php/3626056
|||

hii

sending mail is worked. now i need to send the mail to multirecipients from a table. how could we do that? thank you very much

|||

Hi,

I would use something like this:

use adventureworks

Declare @.Recipients varchar(4000)

select @.Recipients = coalesce(@.Recipients + ';' , '' ) + emailAddress

FROM Person.Contact

PRINT @.Recipients

The results:

a0@.adventure-works.com;a1@.adventure-works.com;aaron0@.adventure-works.com;aaron1@.adventure-works.com;aaron10@.adventure-works.com

|||you're perfect Wink|||Drat - that didn't fix it for me, I still get:

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 5 (2007-06-12T10:46:15). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
)

Outlook express can send fine. I am trying to use a gmail account configured using these settings:

Database Mail SQL 2005

I'm having a problem with database mail in SQL Server 2005. I have set up a default profile. My SMTP server is not a localhost instead i've fed SMTP ip address and port no. The same setting in Outlook express works fine for Incoming and outgoing mails. but in SQL 2005 i'm not able to send test emails. The following errors show up in the sql server agent log

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2006-06-13T10:47:27). Exception Message: Could not connect to mail server. (An established connection was aborted by the software in your host machine).
)

Please help me out....

I have the same problem,

Help please!!!!!!

|||What about testing the sending of Emails using telnet ?

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||yea, got the same problem. We need help with this issue and not a direction to telnet. Thanks|||Yes, sure but telnet will help you to see which error the SMTP server is throwing back during the sending of the message. I don′t want to instruct you using telnet, but thats often the best way to debug the communication.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||i've got the same problem on 64-bit version.
but outlook has sent the e-mails from this computer.

i cannot find in internet some clarifying answer about this problem|||GUYS!!!!!!

It WORK!!!

See:

Database Mail in SQL Server 2005
www.databasejournal.com/features/mssql/article.php/3626056
|||

hii

sending mail is worked. now i need to send the mail to multirecipients from a table. how could we do that? thank you very much

|||

Hi,

I would use something like this:

use adventureworks

Declare @.Recipients varchar(4000)

select @.Recipients = coalesce(@.Recipients + ';' , '' ) + emailAddress

FROM Person.Contact

PRINT @.Recipients

The results:

a0@.adventure-works.com;a1@.adventure-works.com;aaron0@.adventure-works.com;aaron1@.adventure-works.com;aaron10@.adventure-works.com

|||you're perfect Wink|||Drat - that didn't fix it for me, I still get:

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 5 (2007-06-12T10:46:15). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
)

Outlook express can send fine. I am trying to use a gmail account configured using these settings:

Database Mail SQL 2005

I'm having a problem with database mail in SQL Server 2005. I have set up a default profile. My SMTP server is not a localhost instead i've fed SMTP ip address and port no. The same setting in Outlook express works fine for Incoming and outgoing mails. but in SQL 2005 i'm not able to send test emails. The following errors show up in the sql server agent log

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2006-06-13T10:47:27). Exception Message: Could not connect to mail server. (An established connection was aborted by the software in your host machine).
)

Please help me out....

I have the same problem,

Help please!!!!!!

|||What about testing the sending of Emails using telnet ?

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||yea, got the same problem. We need help with this issue and not a direction to telnet. Thanks|||Yes, sure but telnet will help you to see which error the SMTP server is throwing back during the sending of the message. I don′t want to instruct you using telnet, but thats often the best way to debug the communication.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||i've got the same problem on 64-bit version.
but outlook has sent the e-mails from this computer.

i cannot find in internet some clarifying answer about this problem
|||GUYS!!!!!!

It WORK!!!

See:

Database Mail in SQL Server 2005
www.databasejournal.com/features/mssql/article.php/3626056
|||

hii

sending mail is worked. now i need to send the mail to multirecipients from a table. how could we do that? thank you very much

|||

Hi,

I would use something like this:

use adventureworks

Declare @.Recipients varchar(4000)

select @.Recipients = coalesce(@.Recipients + ';' , '' ) + emailAddress

FROM Person.Contact

PRINT @.Recipients

The results:

a0@.adventure-works.com;a1@.adventure-works.com;aaron0@.adventure-works.com;aaron1@.adventure-works.com;aaron10@.adventure-works.com

|||you're perfect Wink|||Drat - that didn't fix it for me, I still get:

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 5 (2007-06-12T10:46:15). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
)

Outlook express can send fine. I am trying to use a gmail account configured using these settings:

Database Mail SQL 2005

I'm having a problem with database mail in SQL Server 2005. I have set up a default profile. My SMTP server is not a localhost instead i've fed SMTP ip address and port no. The same setting in Outlook express works fine for Incoming and outgoing mails. but in SQL 2005 i'm not able to send test emails. The following errors show up in the sql server agent log

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2006-06-13T10:47:27). Exception Message: Could not connect to mail server. (An established connection was aborted by the software in your host machine).
)

Please help me out....

I have the same problem,

Help please!!!!!!

|||What about testing the sending of Emails using telnet ?

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||yea, got the same problem. We need help with this issue and not a direction to telnet. Thanks|||Yes, sure but telnet will help you to see which error the SMTP server is throwing back during the sending of the message. I don′t want to instruct you using telnet, but thats often the best way to debug the communication.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||i've got the same problem on 64-bit version.
but outlook has sent the e-mails from this computer.

i cannot find in internet some clarifying answer about this problem
|||GUYS!!!!!!

It WORK!!!

See:

Database Mail in SQL Server 2005
www.databasejournal.com/features/mssql/article.php/3626056
|||

hii

sending mail is worked. now i need to send the mail to multirecipients from a table. how could we do that? thank you very much

|||

Hi,

I would use something like this:

use adventureworks

Declare @.Recipients varchar(4000)

select @.Recipients = coalesce(@.Recipients + ';' , '' ) + emailAddress

FROM Person.Contact

PRINT @.Recipients

The results:

a0@.adventure-works.com;a1@.adventure-works.com;aaron0@.adventure-works.com;aaron1@.adventure-works.com;aaron10@.adventure-works.com

|||you're perfect Wink|||Drat - that didn't fix it for me, I still get:

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 5 (2007-06-12T10:46:15). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
)

Outlook express can send fine. I am trying to use a gmail account configured using these settings:

Database Mail SQL 2005

I'm having a problem with database mail in SQL Server 2005. I have set up a default profile. My SMTP server is not a localhost instead i've fed SMTP ip address and port no. The same setting in Outlook express works fine for Incoming and outgoing mails. but in SQL 2005 i'm not able to send test emails. The following errors show up in the sql server agent log

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2006-06-13T10:47:27). Exception Message: Could not connect to mail server. (An established connection was aborted by the software in your host machine).
)

Please help me out....

I have the same problem,

Help please!!!!!!

|||What about testing the sending of Emails using telnet ?

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||yea, got the same problem. We need help with this issue and not a direction to telnet. Thanks|||Yes, sure but telnet will help you to see which error the SMTP server is throwing back during the sending of the message. I don′t want to instruct you using telnet, but thats often the best way to debug the communication.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||i've got the same problem on 64-bit version.
but outlook has sent the e-mails from this computer.

i cannot find in internet some clarifying answer about this problem
|||GUYS!!!!!!

It WORK!!!

See:

Database Mail in SQL Server 2005
www.databasejournal.com/features/mssql/article.php/3626056
|||

hii

sending mail is worked. now i need to send the mail to multirecipients from a table. how could we do that? thank you very much

|||

Hi,

I would use something like this:

use adventureworks

Declare @.Recipients varchar(4000)

select @.Recipients = coalesce(@.Recipients + ';' , '' ) + emailAddress

FROM Person.Contact

PRINT @.Recipients

The results:

a0@.adventure-works.com;a1@.adventure-works.com;aaron0@.adventure-works.com;aaron1@.adventure-works.com;aaron10@.adventure-works.com

|||you're perfect Wink|||Drat - that didn't fix it for me, I still get:

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 5 (2007-06-12T10:46:15). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
)

Outlook express can send fine. I am trying to use a gmail account configured using these settings:

Database Mail SMTP Settings

Hi All,
The Sql server will send emails when I am connected to it on the LAN but not
when I am remote or connected via a VPN. I am using the fully qualified
hostname for the smtp server in the database mail configuration.
Here is the error message:
The mail could not be sent to the recipients because of the mail server
failure. (Sending Mail using Account 3 (2007-06-08T16:36:07). Exception
Message: Cannot send mails to mail server. (The operation has timed out.).
Thanks for your help.
JN
On Jun 11, 4:11 pm, "JN" <j...@.ecconsulting.com> wrote:
> Hi All,
> The Sql server will send emails when I am connected to it on the LAN but not
> when I am remote or connected via a VPN. I am using the fully qualified
> hostname for the smtp server in the database mail configuration.
> Here is the error message:
> The mail could not be sent to the recipients because of the mail server
> failure. (Sending Mail using Account 3 (2007-06-08T16:36:07). Exception
> Message: Cannot send mails to mail server. (The operation has timed out.).
> Thanks for your help.
> JN
Hi
Can you ping/telnet the mail server?
Has the server been set to exclude connections via VPNs?
John
|||It looks like the problem is caused by the firewall blocking port 25 on the
smtp server.
Thanks.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:1181581014.987361.279000@.q69g2000hsb.googlegr oups.com...
> On Jun 11, 4:11 pm, "JN" <j...@.ecconsulting.com> wrote:
> Hi
> Can you ping/telnet the mail server?
> Has the server been set to exclude connections via VPNs?
> John
>

Database Mail SMTP Settings

Hi All,
The Sql server will send emails when I am connected to it on the LAN but not
when I am remote or connected via a VPN. I am using the fully qualified
hostname for the smtp server in the database mail configuration.
Here is the error message:
The mail could not be sent to the recipients because of the mail server
failure. (Sending Mail using Account 3 (2007-06-08T16:36:07). Exception
Message: Cannot send mails to mail server. (The operation has timed out.).
Thanks for your help.
JNOn Jun 11, 4:11 pm, "JN" <j...@.ecconsulting.com> wrote:
> Hi All,
> The Sql server will send emails when I am connected to it on the LAN but not
> when I am remote or connected via a VPN. I am using the fully qualified
> hostname for the smtp server in the database mail configuration.
> Here is the error message:
> The mail could not be sent to the recipients because of the mail server
> failure. (Sending Mail using Account 3 (2007-06-08T16:36:07). Exception
> Message: Cannot send mails to mail server. (The operation has timed out.).
> Thanks for your help.
> JN
Hi
Can you ping/telnet the mail server?
Has the server been set to exclude connections via VPNs?
John|||It looks like the problem is caused by the firewall blocking port 25 on the
smtp server.
Thanks.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:1181581014.987361.279000@.q69g2000hsb.googlegroups.com...
> On Jun 11, 4:11 pm, "JN" <j...@.ecconsulting.com> wrote:
>> Hi All,
>> The Sql server will send emails when I am connected to it on the LAN but
>> not
>> when I am remote or connected via a VPN. I am using the fully qualified
>> hostname for the smtp server in the database mail configuration.
>> Here is the error message:
>> The mail could not be sent to the recipients because of the mail server
>> failure. (Sending Mail using Account 3 (2007-06-08T16:36:07). Exception
>> Message: Cannot send mails to mail server. (The operation has timed
>> out.).
>> Thanks for your help.
>> JN
> Hi
> Can you ping/telnet the mail server?
> Has the server been set to exclude connections via VPNs?
> John
>

Database Mail SMTP authentication

I am trying to configure my database mail. It gives me this error when ever I try to send an email out of my domain:

The mail could not be sent to the recipients because of the mail server error.... Mailbox unavailable: The server response was: 5.7.1 unable to relay....

Any suggestions on how to fix this issues. I have read other posts here but not a definitive solution.

Thanks,

Hi Rob - You'll probably get more and better responses from another forum or newsgroup. This one is dedicated to SQL Server Notification Services, which despite the similar name, is not the same technology as Database Mail.|||

Thanks Joe,

Do you know which forum might I try to get an answer to this issue.

|||

Hi Rob. Did you ever get an answer to this question? I'm experiencing the same issues.

Thanks!

|||Relaying is not allowed at the most SMTP servers. It will have to be allowed for either an IPAdress as a source of relaying or as destination domains. These settings can be configured on the remote SMTP server. If its an external one, rather than an internal you are probably out of luck as most providers that only host mail addresses will not allow it.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

Database Mail SMTP authentication

I am trying to configure my database mail. It gives me this error when ever I try to send an email out of my domain:

The mail could not be sent to the recipients because of the mail server error.... Mailbox unavailable: The server response was: 5.7.1 unable to relay....

Any suggestions on how to fix this issues. I have read other posts here but not a definitive solution.

Thanks,

Hi Rob - You'll probably get more and better responses from another forum or newsgroup. This one is dedicated to SQL Server Notification Services, which despite the similar name, is not the same technology as Database Mail.|||

Thanks Joe,

Do you know which forum might I try to get an answer to this issue.

|||

Hi Rob. Did you ever get an answer to this question? I'm experiencing the same issues.

Thanks!

|||Relaying is not allowed at the most SMTP servers. It will have to be allowed for either an IPAdress as a source of relaying or as destination domains. These settings can be configured on the remote SMTP server. If its an external one, rather than an internal you are probably out of luck as most providers that only host mail addresses will not allow it.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

Database Mail SMTP authentication

SS 2005 Standard 64bit

I configured database mail and I suspect the SMTP authentication credentials are not being sent. Here are the two scenarios I have tried:

1) Use a local exchange server with basic authentication passing network credentials that have access to use the exchange service. I have a SS 2000 machine that is configure this way. Sending email to an address outside the domain fails with

"mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2006-08-25T14:02:23). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Unable to relay for ...."

I can send emails within the domain no matter what the credentials specified in basic authentication are, including invalid users.

2) Use a remote smtp server with basic authentication passing username (email address) and password, which fails with "The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2006-08-25T12:56:22). Exception Message: Cannot send mails to mail server. (Transaction failed. The server response was: 5.7.1 myaddress@.me.com: Sender address rejected: Access denied)."

any idears?

Hi,

I have the same problem, I can't even send emails within the domain.

Help Please!!!!

|||

You'll probably have more luck in another forum or newsgroup. This one is dedicated to SQLNS.

But for starters, try this link:

http://groups.google.com/group/microsoft.public.sqlserver.server/browse_frm/thread/fc3ca8d7d6589a0f/8c9a329972d2feeb?lnk=st&q=database+mail+sql+server+authentication&rnum=1&hl=en#8c9a329972d2feeb

HTH...

Joe

Database Mail SMTP authentication

SS 2005 Standard 64bit

I configured database mail and I suspect the SMTP authentication credentials are not being sent. Here are the two scenarios I have tried:

1) Use a local exchange server with basic authentication passing network credentials that have access to use the exchange service. I have a SS 2000 machine that is configure this way. Sending email to an address outside the domain fails with

"mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2006-08-25T14:02:23). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Unable to relay for ...."

I can send emails within the domain no matter what the credentials specified in basic authentication are, including invalid users.

2) Use a remote smtp server with basic authentication passing username (email address) and password, which fails with "The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2006-08-25T12:56:22). Exception Message: Cannot send mails to mail server. (Transaction failed. The server response was: 5.7.1 myaddress@.me.com: Sender address rejected: Access denied)."

any idears?

Hi,

I have the same problem, I can't even send emails within the domain.

Help Please!!!!

|||

You'll probably have more luck in another forum or newsgroup. This one is dedicated to SQLNS.

But for starters, try this link:

http://groups.google.com/group/microsoft.public.sqlserver.server/browse_frm/thread/fc3ca8d7d6589a0f/8c9a329972d2feeb?lnk=st&q=database+mail+sql+server+authentication&rnum=1&hl=en#8c9a329972d2feeb

HTH...

Joe

Database Mail SMTP authentication

SS 2005 Standard 64bit

I configured database mail and I suspect the SMTP authentication credentials are not being sent. Here are the two scenarios I have tried:

1) Use a local exchange server with basic authentication passing network credentials that have access to use the exchange service. I have a SS 2000 machine that is configure this way. Sending email to an address outside the domain fails with

"mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2006-08-25T14:02:23). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Unable to relay for ...."

I can send emails within the domain no matter what the credentials specified in basic authentication are, including invalid users.

2) Use a remote smtp server with basic authentication passing username (email address) and password, which fails with "The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2006-08-25T12:56:22). Exception Message: Cannot send mails to mail server. (Transaction failed. The server response was: 5.7.1 myaddress@.me.com: Sender address rejected: Access denied)."

any idears?

Hi,

I have the same problem, I can't even send emails within the domain.

Help Please!!!!

|||

You'll probably have more luck in another forum or newsgroup. This one is dedicated to SQLNS.

But for starters, try this link:

http://groups.google.com/group/microsoft.public.sqlserver.server/browse_frm/thread/fc3ca8d7d6589a0f/8c9a329972d2feeb?lnk=st&q=database+mail+sql+server+authentication&rnum=1&hl=en#8c9a329972d2feeb

HTH...

Joe

Database mail setup

SQL server 2005 standard edition
Windows NT 5.1 [2600]
I am able to configure and test database mail. But when I am trying to
configure SQL Server Agent to use database mail I see only "guest" database
user. What am i missing?
ontario, canada
Where are you seeing only guest database user? It sounds
like you are looking in the wrong place.
To configure Agent to use database mail, select the
properties for Agent in Management Studio, go to Alert
System. Under mail session, select the checkbox for Enable
mail profile. Select Database Mail for the Mail System. And
then select the profile or one of the profiles you have
setup for database mail.
-Sue
On Fri, 10 Aug 2007 07:06:04 -0700, db
<db@.discussions.microsoft.com> wrote:

>SQL server 2005 standard edition
>Windows NT 5.1 [2600]
>I am able to configure and test database mail. But when I am trying to
>configure SQL Server Agent to use database mail I see only "guest" database
>user. What am i missing?

Database mail setup

SQL server 2005 standard edition
Windows NT 5.1 [2600]
I am able to configure and test database mail. But when I am trying to
configure SQL Server Agent to use database mail I see only "guest" database
user. What am i missing?
--
ontario, canadaWhere are you seeing only guest database user? It sounds
like you are looking in the wrong place.
To configure Agent to use database mail, select the
properties for Agent in Management Studio, go to Alert
System. Under mail session, select the checkbox for Enable
mail profile. Select Database Mail for the Mail System. And
then select the profile or one of the profiles you have
setup for database mail.
-Sue
On Fri, 10 Aug 2007 07:06:04 -0700, db
<db@.discussions.microsoft.com> wrote:
>SQL server 2005 standard edition
>Windows NT 5.1 [2600]
>I am able to configure and test database mail. But when I am trying to
>configure SQL Server Agent to use database mail I see only "guest" database
>user. What am i missing?

Database mail setup

SQL server 2005 standard edition
Windows NT 5.1 [2600]
I am able to configure and test database mail. But when I am trying to
configure SQL Server Agent to use database mail I see only "guest" database
user. What am i missing?
--
ontario, canadaWhere are you seeing only guest database user? It sounds
like you are looking in the wrong place.
To configure Agent to use database mail, select the
properties for Agent in Management Studio, go to Alert
System. Under mail session, select the checkbox for Enable
mail profile. Select Database Mail for the Mail System. And
then select the profile or one of the profiles you have
setup for database mail.
-Sue
On Fri, 10 Aug 2007 07:06:04 -0700, db
<db@.discussions.microsoft.com> wrote:

>SQL server 2005 standard edition
>Windows NT 5.1 [2600]
>I am able to configure and test database mail. But when I am trying to
>configure SQL Server Agent to use database mail I see only "guest" database
>user. What am i missing?

Database mail running on cluster error

Hi

we are running Sql 2005 enterprise edition sp1 on a 2 node cluster.When we send a test message via database mail we recieve the following error

Date 3/7/2007 9:11:18 AM
Log Database Mail (Database Mail Log)

Log ID 5
Process ID 2892
Last Modified 3/7/2007 9:11:18 AM
Last Modified By JDG\pssqlservice

Message
1) Exception Information
===================
Exception Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Data: System.Collections.ListDictionaryInternal
TargetSite: Microsoft.SqlServer.Management.SqlIMail.Server.Objects.Account GetAccount(Int32)
HelpLink: NULL
Source: DatabaseMailEngine

StackTrace Information
===================
at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID)
at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.SessionManager.GetAccount(Int32 accountID)
at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandFactory.CreateSendMailCommand(DBSession dbSession)
at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandFactory.CreateCommand(DBSession dbSession)
at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandRunner.Run(DBSession db)
at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.ThreadCallBack.MailOperation(Object o)

Does anybody know what could be the problem here?

Just a guess here: No known FROM address provided...|||we do have a reply address configured in the batabase mail configuration.so it is not this

Database Mail question?

Hello All!

So I learned this cool thing today called Database Mail. I have a statement that will allow me to perform a query, and send a email with the results in a table form in a HTML format. What I would like to do is place more than one table. I have several tables to send, I don't want to send 5 emails. I want to send 1 email with 5 tables in it. Here some code!

TIA!

Rudy

DECLARE @.xml NVARCHAR(MAX)DECLARE @.body NVARCHAR(MAX)

BEGIN

SET @.xml =CAST(( SELECT Service_Date_Time AS 'td'

FROM [Pharm Test Local].dbo.Active_Orders WHERE (Service_Date_Time <= dateadd( Month, -9, getdate())) GROUP BY Service_Date_Time FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))

SET @.body ='<html><H1>Records that have expired.</H1><body bgcolor=White><table border = 2><tr><th>I-9</th></tr>' SET @.body = @.body + @.xml +'</table></body></html>'

SET @.xml =CAST(( SELECT Service_Date_Time AS 'td'

FROM [Pharm Test Local].dbo.Archive_Orders WHERE (Service_Date_Time <= dateadd( Month, -2, getdate())) GROUP BY Service_Date_Time FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))

SET @.body ='<html><H1>Records that have expired1.</H1><body bgcolor=White><table border = 2><tr><th>Workers Comp</th></tr>' SET @.body = @.body + @.xml +'</table></body></html>'

EXEC msdb.dbo.sp_send_dbmail

@.recipients=N'jrudolf@.ikon.com',

@.body= @.body,

@.body_format = 'HTML',

@.Subject='HR Records to delete',

@.profile_name = 'Ikon'

end

YOu can just combine them. You can also use UNION/All to combine them into a single query.

DECLARE @.xml NVARCHAR(MAX)DECLARE @.body NVARCHAR(MAX)

BEGIN

SET @.xml =CAST(( SELECT Service_Date_Time AS 'td'

FROM [Pharm Test Local].dbo.Active_Orders WHERE (Service_Date_Time <= dateadd( Month, -9, getdate())) GROUP BY Service_Date_Time FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))

+CAST(( SELECT Service_Date_Time AS 'td'

FROM [Pharm Test Local].dbo.Archive_Orders WHERE (Service_Date_Time <= dateadd( Month, -2, getdate())) GROUP BY Service_Date_Time FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))

SET @.body ='<html><H1>Records that have expired1.</H1><body bgcolor=White><table border = 2><tr><th>Workers Comp</th></tr>' SET @.body = @.body + @.xml +'</table></body></html>'

EXEC msdb.dbo.sp_send_dbmail

@.recipients=N'jrudolf@.ikon.com',

@.body= @.body,

@.body_format = 'HTML',

@.Subject='HR Records to delete',

@.profile_name = 'Ikon'

end

|||

Thanks Oj! It worked great!

Rudy

Database Mail question?

Hello All!

So I learned this cool thing today called Database Mail. I have a statement that will allow me to perform a query, and send a email with the results in a table form in a HTML format. What I would like to do is place more than one table. I have several tables to send, I don't want to send 5 emails. I want to send 1 email with 5 tables in it. Here some code!

TIA!

Rudy

DECLARE @.xml NVARCHAR(MAX)DECLARE @.body NVARCHAR(MAX)

BEGIN

SET @.xml =CAST(( SELECT Service_Date_Time AS 'td'

FROM [Pharm Test Local].dbo.Active_Orders WHERE (Service_Date_Time <= dateadd( Month, -9, getdate())) GROUP BY Service_Date_Time FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))

SET @.body ='<html><H1>Records that have expired.</H1><body bgcolor=White><table border = 2><tr><th>I-9</th></tr>' SET @.body = @.body + @.xml +'</table></body></html>'

SET @.xml =CAST(( SELECT Service_Date_Time AS 'td'

FROM [Pharm Test Local].dbo.Archive_Orders WHERE (Service_Date_Time <= dateadd( Month, -2, getdate())) GROUP BY Service_Date_Time FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))

SET @.body ='<html><H1>Records that have expired1.</H1><body bgcolor=White><table border = 2><tr><th>Workers Comp</th></tr>' SET @.body = @.body + @.xml +'</table></body></html>'

EXEC msdb.dbo.sp_send_dbmail

@.recipients=N'jrudolf@.ikon.com',

@.body= @.body,

@.body_format = 'HTML',

@.Subject='HR Records to delete',

@.profile_name = 'Ikon'

end

YOu can just combine them. You can also use UNION/All to combine them into a single query.

DECLARE @.xml NVARCHAR(MAX)DECLARE @.body NVARCHAR(MAX)

BEGIN

SET @.xml =CAST(( SELECT Service_Date_Time AS 'td'

FROM [Pharm Test Local].dbo.Active_Orders WHERE (Service_Date_Time <= dateadd( Month, -9, getdate())) GROUP BY Service_Date_Time FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))

+CAST(( SELECT Service_Date_Time AS 'td'

FROM [Pharm Test Local].dbo.Archive_Orders WHERE (Service_Date_Time <= dateadd( Month, -2, getdate())) GROUP BY Service_Date_Time FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))

SET @.body ='<html><H1>Records that have expired1.</H1><body bgcolor=White><table border = 2><tr><th>Workers Comp</th></tr>' SET @.body = @.body + @.xml +'</table></body></html>'

EXEC msdb.dbo.sp_send_dbmail

@.recipients=N'jrudolf@.ikon.com',

@.body= @.body,

@.body_format = 'HTML',

@.Subject='HR Records to delete',

@.profile_name = 'Ikon'

end

|||

Thanks Oj! It worked great!

Rudy

Database Mail Problems / Job Notifications...

I've read an extensive bit about this problem in several forums and so far none of the information has helped me to determine if there is a bug in SQL 2005 x64 regardless of version or SP or if I just don't know how to do this correctly.

I can send a test email from db mail but when a job fails it does not send an email to an operator. I have monitored the IIS logs to see if it is trying to send and it is not. Database mail is enabled in Surface AC and in SQL Agent [one odd thing is that the 'test' button is only available on the SQL Agent Alerts page if I use SQL Mail]. No specific error happens (in the mail log, sql agent log, or application event log) when I try to send mail from a failed job. Mail accounts and credentials are valid. Please note that in the steps listed below, I have restarted the SQL Agent Service each time I make a change.

I've tried deleting and recreating the operators (they are enabled). I've tried using a mail server that uses anonymous authentication as well (I changed this back to one that uses basic authentication). The profiles were made default and public. (Though this shouldn't ever have to be done, as the account is a sysadmin) the SQLServer2005SQLAgentUser was explicitly added to the msdb DatabaseMail user role.

This query works, so I know that the job is not trying to execute the sp:

USE msdb ;

GO

EXEC dbo.sp_notify_operator

@.profile_name = N'staging monitor',

@.name = N'Charles Evans',

@.subject = N'Test Notification',

@.body = N'Successfully emailed profile.' ;

GO

This is happening in SQL 2005 x64 EE and x64 DE SP1 and SP2 respectively. Any thoughts on what else this could be? The same setup works fine in SQL 2005 SE x86 SP1.

Check the following article...

How to configure SQL Server Agent to send job status notifications and alert notifications in SQL Server 2005 64-bit editions

http://support.microsoft.com/kb/908360

|||So the only way is to use SQL Mail, instead of database mail?|||

SQL Server Agent is not integrated with Database Mail or with SQL Mail in Microsoft SQL Server 2005 64-bit editions.

Please read the article... you can setup mail using SMTP where SQL mail uses MAPI ...

|||

In SP0 this is true - according to the article:

"In SQL Server 2005 Service Pack 1 (SP1), you can use SQL Server Agent to interact with Database Mail as the mailing system on 64-bit operating systems."

I've made this work in our production system now with SP-1 EE x64, there was a permissions issue. However, things are not working in our staging environment SP-2 DE x64 with the same setup and account settings/permissions.

I'll keep posted if I figure out why not in staging.

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 ?

|||

We have same problem for some time. it has been fixed for us after I made some changes to the security setting and rebooted the server..

We are running SQL 2005 on Windows 2003 SP1. Check the following link

http://support.microsoft.com/default.aspx/kb/926642/en-us

Faeed

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 ?

|||

We have same problem for some time. it has been fixed for us after I made some changes to the security setting and rebooted the server..

We are running SQL 2005 on Windows 2003 SP1. Check the following link

http://support.microsoft.com/default.aspx/kb/926642/en-us

Faeed