???????????????SP?????????
????EXEC sp_SendDatabaseMail
????@recipients = '001@test.com; 002@test.com;'??
????@body = 'This is a testing mail'??
????@HtmlBody = 'Testing Database Mail'
????SQL Server 2005?????Database Mail????????£?
????--1. ????database mail
????use master
????GO
????exec sp_configure 'show advanced options'??1
????reconfigure
????exec sp_configure 'Database mail XPs'??1
????reconfigure
????GO
????--2. ???account
????exec msdb..sysmail_add_account_sp
????@account_name            = 'SqlAlert'                -- mail account
??????@email_address           = 'SqlAlert@test.com'       -- sendmail address
??????@display_name            = 'SqlAlert'                -- sendusername
??????@replyto_address         = null
??????@description             = null
??????@mailserver_name         = '***??***??***??***'         -- SMTP Address
??????@mailserver_type         = 'SMTP'                    -- SQL 2005 only support SMTP
??????@port                    = 25                        -- port
????--??@username                = '*********@test.com'    -- account
????--??@password                = '******************'    -- pwd
??????@use_default_credentials = 0
??????@enable_ssl              = 0                         --is ssl enabled on SMTP server
??????@account_id              = null
????--3. ???profile
????exec msdb..sysmail_add_profile_sp
????@profile_name = 'SqlAlert'         -- profile name
??????@description  = 'dba mail profile' -- profile description
??????@profile_id   = null
????--4. ????account and profile
????exec msdb..sysmail_add_profileaccount_sp
????@profile_name    = 'SqlAlert'     -- profile name
??????@account_name    = 'SqlAlert'     -- account name
??????@sequence_number = 1              -- account order in profile
????--5. ????database mail
????EXEC msdb.dbo.sp_send_dbmail
????@profile_name = 'SqlAlert'??
????@recipients = '001@test.com; 002@test.com;'??
????@body = 'This is a testing mail'??
????@subject = 'Testing Database Mail';
????GO
???????SMTP????????????????磺??????smtp????????SSL???????????????????£?????????????????
????????
????(1) ?澯??????????澯?????????????????У??澯????????????????????y??????????????????????????
????(2) ?澯?????????????????????澯???????????????????????
????(3) ????????????ó???/????????????????????????UTF-8??????????????????????????