xp_sendmail
--[@recipients =] 'recipients [;...n]'
[,[@message =] 'message'] --[@body]
-- [,[@query =] 'query']
[,[@attachments =] 'attachments [;...n]'] --@file_attachments
-- [,[@copy_recipients =] 'copy_recipients [;...n]'
-- [,[@blind_copy_recipients =] 'blind_copy_recipients [;...n]'
-- [,[@subject =] 'subject']
[,[@type =] 'type'] --@body_format ??????
[,[@attach_results =] 'attach_value']--@attach_query_result_as_file --true=1, fails=0
[,[@no_output =] 'output_value'] --@exclude_query_output --=0輸出,=1不輸出
[,[@no_header =] 'header_value'] --@query_result_header
[,[@width =] width] --@query_result_width
[,[@separator =] 'separator'] --@query_result_separator
[,[@echo_error =] 'echo_value'] --@append_query_error --while is error, @=1(即@echo_error=true),sendmail ;@=0, not sendmail ;
[,[@set_user =] 'user']
[,[@dbuse =] 'database']--@execute_query_database
sp_send_dbmail [ [ @profile_name = ] 'profile_name' ]
[ , [ @recipients = ] 'recipients [ ; ...n ]' ]
[ , [ @copy_recipients = ] 'copy_recipient [ ; ...n ]' ]
[ , [ @blind_copy_recipients = ] 'blind_copy_recipient [ ; ...n ]' ]
[ , [ @subject = ] 'subject' ]
[ , [ @body = ] 'body' ]
[ , [ @body_format = ] 'body_format' ]
[ , [ @importance = ] 'importance' ]
[ , [ @sensitivity = ] 'sensitivity' ]
[ , [ @file_attachments = ] 'attachment [ ; ...n ]' ]
[ , [ @query = ] 'query' ]
[ , [ @execute_query_database = ] 'execute_query_database' ]
[ , [ @attach_query_result_as_file = ] attach_query_result_as_file ]
[ , [ @query_attachment_filename = ] query_attachment_filename ]
[ , [ @query_result_header = ] query_result_header ]
[ , [ @query_result_width = ] query_result_width ]
[ , [ @query_result_separator = ] 'query_result_separator' ]
[ , [ @exclude_query_output = ] exclude_query_output ]
[ , [ @append_query_error = ] append_query_error ]
[ , [ @query_no_truncate = ] query_no_truncate ]
[ , [ @mailitem_id = ] mailitem_id ] [ OUTPUT ]