Wednesday, March 28, 2012

How to using database mail to send mail with attchment?

Hi All:
i can send email by using database mail function, but i don't know how to
send witha attachemtn?
Cheers
NickSince you are speaking of DBMail I will assume you are using 2005.
use the sp_send_dbmail (Transact-SQL)
with the
[ @.file_attachments = ] 'file_attachments',
[ @.attach_query_result_as_file = ] attach_query_result_as_file
[ @.query_attachment_filename = ] query_attachment_filename
http://msdn2.microsoft.com/en-us/library/ms190307.aspx
for 2000 I would write a custom executable.
thanks,
/*
Warren Brunk - MCITP - SQL 2005, MCDBA
www.techintsolutions.com
*/
"Nick" <Nick@.discussions.microsoft.com> wrote in message
news:2F1F7DB8-67BF-4B88-9372-8CFBA0DE0650@.microsoft.com...
> Hi All:
> i can send email by using database mail function, but i don't know how to
> send witha attachemtn?
> Cheers
> Nick|||Thanks for your reply.
"Warren Brunk" wrote:

> Since you are speaking of DBMail I will assume you are using 2005.
> use the sp_send_dbmail (Transact-SQL)
> with the
> [ @.file_attachments = ] 'file_attachments',
> [ @.attach_query_result_as_file = ] attach_query_result_as_file
> [ @.query_attachment_filename = ] query_attachment_filename
> http://msdn2.microsoft.com/en-us/library/ms190307.aspx
> for 2000 I would write a custom executable.
> thanks,
> --
> /*
> Warren Brunk - MCITP - SQL 2005, MCDBA
> www.techintsolutions.com
> */
>
> "Nick" <Nick@.discussions.microsoft.com> wrote in message
> news:2F1F7DB8-67BF-4B88-9372-8CFBA0DE0650@.microsoft.com...
>
>

No comments:

Post a Comment