Syntax for sp_send_cdosysmail (based on CDOSYS):
Exec master.dbo.sp_send_cdosysmail
@To (varchar(2048)) - Recipient e-mail address list separating each with a ';'
or a ','. Use a '?' to return the syntax.
@Body (varchar(8000)) - Text body; use embedded char(13) + char(10)
for carriage returns. The default is nothing
@Subject (varchar(255))) - E-mail subject. The default is a message from
@@servername.
@Attachments (varchar(1024)) - Attachment list separating each with a ';'.
The default is no attachments.
@From (varchar(128)) - Sender list defaulted to @@ServerName.
@CC (varchar(2048)) - CC list separating each with a ';' or a ','
The default is no CC addresses.
@BCC (varchar(2048)) - Blind CC list separating each with a ';' or a ','
The default is no BCC addresses.
@SMTPServer (varchar(255)) - Network smtp server defaulted to your companies network
smtp server. Set this in the stored proc code.
Example:
sp_send_cdosysmail '<user@mycompany.com>', 'This is a test', @SMTPServer = <network smtp relay server>
The above example will send an smpt e-mail to <user@mycompany.com> from @@ServerName
with a subject of 'Message from SQL Server <@@ServerName>' and a
text body of 'This is a test' using the network smtp server specified.
Be sure to set the default for @SMTPServer before compiling this stored procedure.