数据库邮件不会发送电子邮件

我想在MS SQL 2005中设置数据库邮件。我设置,但每次我尝试通过他们的电子邮件testing发送一个味精,它失败,我得到这个味精。

date7/7/2010 10:54:12日志数据库邮件(数据库邮件日志)

日志ID 48进程ID 2148邮件项目ID 23上次修改时间7/7/2010 10:54:12 AM上次修改者:sa

消息由于邮件服务器故障,邮件无法发送给收件人。 (使用帐户1发送邮件(2010-07-07T10:54:11)。exception消息:无法向邮件服务器发送邮件(发送邮件失败)。

我不明白为什么。 我正在使用我的isp smtp,它使用数据库邮件短时间工作。 我什至通过cmd提示ping我的smtp服务器,我可以达到它。 所以我不明白为什么它不起作用。

我甚至尝试过我的托pipe公司smtp和Gmail的smtp。 我总是得到相同的味精。

当我尝试教程提供我的Km_我得到

1) Exception Information =================== Exception Type: System.NullReferenceException Message: Object reference not set to an instance of an object. Data: System.Collections.ListDictionaryInternal TargetSite: Microsoft.SqlServer.Management.SqlIMail.Server.Objects.Account GetAccount(Int32) HelpLink: NULL Source: DatabaseMailEngine StackTrace Information =================== at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID) at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.SessionManager.GetAccount(Int32 accountID) at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandFactory.CreateSendMailCommand(DBSession dbSession) at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandFactory.CreateCommand(DBSession dbSession) at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandRunner.Run(DBSession db) at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.ThreadCallBack.MailOperation(Object o) 

数据库邮件选项是否打开? 如果不使用此脚本并确保它处于打开状态

 sp_CONFIGURE 'show advanced', 1 GO RECONFIGURE GO sp_CONFIGURE 'Database Mail XPs', 1 GO RECONFIGURE GO sp_CONFIGURE 'show advanced', 0 GO RECONFIGURE GO 

另外确保端口25是打开的。 如果你正在使用Gmail,你可能不得不使用端口587.看看这个博客

这种事情可能会失败的原因有很多。 不幸的是,你得到的日志不够详细,以确定它的确切原因。 我怀疑这种情况是邮件中的“发件人:”地址configuration不正确。 大多数邮件程序要求“收件人:”或“发件人:”地址位于本地域列表中(例如“gmail.com”),并且不接受没有此项的邮件。 因此,如果您的邮件来自“[email protected]”,并发送到“[email protected]”,但通过本地ISP的邮件转发,则ISP的邮件程序将拒绝该邮件。 如果你可以configurationauthentication的SMTP,这种事情可以绕过。