Sql server SQL Server 2014数据库邮件未发送

Sql server SQL Server 2014数据库邮件未发送,sql-server,Sql Server,我在SQL Server 2014上玩得很开心。。。我的数据库邮件没有发送,我找不到地方了。我仔细检查了DBmail可执行文件的SQL帐户权限-它已读取并执行。我尝试了另一个具有相同未发送问题的邮件帐户和配置文件 我运行下面的查询,如下所述 步骤1 检查数据库所有者的权限 设置#2 USE MASTER GO SP_CONFIGURE 'show advanced options', 1 RECONFIGURE WITH OVERRIDE GO SP_CONFIGURE 'Database

我在SQL Server 2014上玩得很开心。。。我的数据库邮件没有发送,我找不到地方了。我仔细检查了DBmail可执行文件的SQL帐户权限-它已读取并执行。我尝试了另一个具有相同未发送问题的邮件帐户和配置文件

我运行下面的查询,如下所述

步骤1

检查数据库所有者的权限

设置#2

USE MASTER
GO

SP_CONFIGURE 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
GO

SP_CONFIGURE 'Database Mail XPs', 1
RECONFIGURE WITH OVERRIDE
GO

SP_CONFIGURE 'show advanced options', 0
RECONFIGURE WITH OVERRIDE
GO
和以上查询成功运行,无任何错误

步骤3

使用下面的查询配置数据库邮件

EXECUTE msdb.dbo.sysmail_add_profile_sp  
    @profile_name = 'P2PEmailNotifications',  
    @description = 'Profile used for sending outgoing notifications using Gmail.' ;  
GO

EXECUTE msdb.dbo.sysmail_add_principalprofile_sp  
    @profile_name = 'P2PEmailNotifications',  
    @principal_name = 'public',  
    @is_default = 1 ;
GO

EXECUTE msdb.dbo.sysmail_add_account_sp  
    @account_name = 'MyGmail',  
    @description = 'Mail account for sending outgoing notifications.',  
    @email_address = 'MyGmailSMTPEMAIL@gmail.com',  
    @display_name = 'no-reply@ubl.com.pk',  
    @mailserver_name = 'smtp.gmail.com',
    @port = 555,
    @enable_ssl = 1,
    @username = 'MyGmailSMTPEMAIL@gmail.com',
    @password = 'xxxxxxx' ;  
GO

EXECUTE msdb.dbo.sysmail_add_profileaccount_sp  
    @profile_name = 'P2PEmailNotifications',  
    @account_name = 'MyGmail',  
    @sequence_number =1 ;  
GO
步骤4

现在,尝试使用以下查询执行dbmail:

EXEC [msdb].[dbo].[sp_send_dbmail] 
     @profile_name = 'P2PEmailNotifications', 
     @recipients = 'xxx.xxx.xxx@outlook.com', 
     @subject = @Subject2,
     @body = @Body2,
     @body_format = 'HTML'
输出

现在,在我的结果窗口中任何地方都找不到错误

步骤5

因此,我使用这些查询来检查在发送dbmail并运行它时是否存在任何错误:

SELECT * 
FROM msdb..sysmail_event_log 
ORDER BY log_id DESC

这是“说明”列中的错误:

由于邮件服务器故障,邮件无法发送给收件人。(使用帐户9发送邮件(2019-04-11T00:21:06)。异常消息:无法连接到邮件服务器。(连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机没有响应64.233.167.109:555)。 )

看到错误后,我重复了第3步,更改了不同的gmail电子邮件,并将端口555更改为587,之后我在“描述”列中收到以下错误

例外信息

异常类型:Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException

消息:无法从队列中检索项目。原因:可以发送此邮件的帐户列表为空(可能是由于使用了无效的配置文件)

数据:System.Collections.ListDictionaryInternal
TargetSite:Microsoft.SqlServer.Management.SqlIMail.Server.Controller.ICommand CreateSendMailCommand(Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DBSession)
帮助链接:空
来源:DatabaseMailEngine

堆栈跟踪信息

在Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandFactory.CreateSendMailCommand(DBSession DBSession)
在Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandRunner.Run(dbsessiondb)中 位于Microsoft.SqlServer.Management.SqlIMail.IMailProcess.ThreadCallBack.MailOperation(对象obj)

结论

我有一个发送状态为“失败”的项目队列。正如我简要描述我的问题。所以,我需要你们开发人员提供一些答案,我在上述步骤中犯的错误是我遗漏了一些东西,或者这是SQL Server 2014的一个已知问题,而我在搜索中没有这样做?要发送此邮件,还有其他可能的步骤吗?

请检查:
SELECT * FROM dbo.sysmail_sentitems