use master
go
exec sp_configure 'show advanced options',1
go
reconfigure
go
exec sp_configure 'Database mail XPs',1
go
reconfigure
go
--添加gmail邮件
exec msdb..sysmail_add_account_sp
@account_name = 'jqtj_profile' -- 邮件帐户名称(SQL Server 使用)
,@email_address = 'jqtjxx@dawawa.com' -- 发件人邮件地址
,@display_name = 'jqtjxx' -- 发件人姓名
,@replyto_address = 'jqtjxx@dawawa.com'
,@description = null
,@mailserver_name = 'mail.game.17lele.com' -- 邮件服务器地址
,@mailserver_type = 'SMTP' -- 邮件协议(SQL 2005 只支持 SMTP)
,@port = 25 -- 邮件服务器端口
,@username = 'xxxx' -- 用户名
,@password = 'xxxxxxxxxxx' -- 密码
,@use_default_credentials = 0
,@enable_ssl = 0
,@account_id = 1
go
exec msdb..sysmail_add_profile_sp @profile_name = 'jqtj_profile' -- profile 名称
,@description = 'dba mail profile' -- profile 描述
,@profile_id = null
go
exec msdb..sysmail_add_profileaccount_sp @profile_name = 'jqtj_profile' -- profile 名称
,@account_name = 'jqtj_profile' -- account 名称
,@sequence_number = 1 -- account 在 profile 中顺序
go
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22359110/viewspace-712861/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22359110/viewspace-712861/