但我收到以下错误:
Msg 15281,Level 16,State 1,
Procedure sp_send_dbmail,Line 0
sql Server blocked access to procedure
‘dbo.sp_send_dbmail’ of component
‘Database Mail XPs’ because this
component is turned off as part of the
security configuration for this
server.
A system administrator can
enable the use of ‘Database Mail XPs’
by using sp_configure. For more
information about enabling ‘Database
Mail XPs’,see “Surface Area
Configuration” in sql Server Books
Online.
我还尝试使用此代码在sql Server 2008 R2 EXPRESS中发送SMTP邮件:
http://www.freevbcode.com/ShowCode.asp?ID=6699
但我收到以下错误:
Msg 15281,
Procedure sp_OACreate,Line 1
sql Server blocked access to procedure
‘sys.sp_OACreate’ of component ‘Ole
Automation Procedures’ because this
component is turned off as part of the
security configuration for this
server. A system administrator can
enable the use of ‘Ole Automation
Procedures’ by using sp_configure. For
more information about enabling ‘Ole
Automation Procedures’,see “Surface
Area Configuration” in sql Server
Books Online.
我去了“Facets”检查那里的安全选项,但没有关于“表面区域配置”的内容!是不是因为我使用的是sql Server 2008 R2的Express版本?还是我朝错误的方向走?
解决方法
阶段2:
您只需要在msdb中配置一些表.这些是需要配置的表:
> sysmail_account – >创建默认邮件帐户
> sysmail_profile – >创建一个默认配置文件(sp_send_dbmail需要这个)
> sysmail_profileaccount – >根据2个配置文件ID将相关数据添加到此
> sysmail_server – >从您将用于发送电子邮件的电子邮件帐户创建邮件服务器.如果您不知道服务器类型,请查看sysmail_servertype内部.
更新这些表后刷新msdb并尝试使用sp_send_dbmail发送电子邮件
如果您按照所有这些步骤操作,则可以使用sp_send_dbmail在sql 2008 r2 express中发送电子邮件.
我做了5次测试,但进展顺利.
Talley Ouro罗利talleyouro@hotmail.com