1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| select @FROM = N'MyEmail@MyDomain.com',
@FROM_NAME = N'Joe Mailman',
@TO = N'MyFriend@HisDomain.com',
@CC = N'',
@BCC = N'',
@priority = N'High',
@subject = N'SQL Server SMTP mail',
@message = N'<HTML><H1>Hello SQL Server SMTP SQL Mail</H1></HTML>',
@type = N'text/html',
@attachments = N'',
@codepage = 0
exec @rc = master.dbo.xp_smtp_sendmail
@FROM = @FROM,
@TO = @TO,
@CC = @CC,
@BCC = @BCC,
@priority = @priority,
@subject = @subject,
@message = @message,
@type = @type,
@attachments = @attachments,
@codepage = @codepage,
@server = N'mail.sqldev.net'
select RC = @rc
go |
Partager