这个选项是在服务器启用SQL Mail。有两个值,一个是0表示SQL Mail不可用(默认值),另一个为1表示SQL Mail可用。
执行下面代码:
EXEC
master..xp_sendmail
@recipients = ' test@mailaddress.com ' , -- 测试邮件地址
@subject = ' SQL Server mail test ' ,
@message = ' Hello, Insus.NET. '
@recipients = ' test@mailaddress.com ' , -- 测试邮件地址
@subject = ' SQL Server mail test ' ,
@message = ' Hello, Insus.NET. '
如果SQL Mail没有在服务器启用,会显示:
启用SQL Mail:
SP_CONFIGURE
'
show advanced options
'
,
1
;
GO
RECONFIGURE ;
GO
SP_CONFIGURE ' SQL Mail XPs ' , 1 ; -- 1启用,0禁用。
GO
RECONFIGURE ;
GO
GO
RECONFIGURE ;
GO
SP_CONFIGURE ' SQL Mail XPs ' , 1 ; -- 1启用,0禁用。
GO
RECONFIGURE ;
GO