Send bulk email from SQL Server 2008

I am relatively new to databases, so please forgive me if my query sounds trivial. I need to send a bulk email address to all the contacts listed in a specific table. The body of the letter is stored in a .doc file, which begins with Dear Mr. _______. The SQL server will read this file, add the last name of the contact to the empty space, and send it to the corresponding email address for this last name. Any thoughts on how to do this?

Any ideas, suggestions, tips will be appreciated.

Thank!

+3
source share
4 answers

= . . , , . , .

, . . / .

+6

, , :

EXEC msdb.dbo.sp_send_dbmail...

, (SELECT/INSERT/UPDATE/DELETE), .

http://technet.microsoft.com/en-us/library/ms190307.aspx

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 ]

, .DOC SQL, Word, SQl Server :

http://msdn.microsoft.com/en-us/library/aa140183%28office.10%29.aspx

+4

SQL Server .

( ) , , , SMTP-. 200 #.NET, .

+4

SQLAnswersMail SQL Server 2000 , .

, SQL Server - , , ( SQL-). .

, , SQL Server 2005. , SQL Server 2000 MAPI, .

+2

Source: https://habr.com/ru/post/1736127/


All Articles