gpt4 book ai didi

sql-server - SQL Server sp_send_dbmail - 如何将邮件发送到 Gmail?

转载 作者:行者123 更新时间:2023-12-02 22:29:34 25 4
gpt4 key购买 nike

我正在使用 sp_send_dbmail,它工作正常,除非我使用 Gmail 帐户发送给收件人。数据库邮件日志给出以下错误:

Error,80,The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2015-05-29T13:22:39). Exception Message: Cannot send mails to mail server. (Unable to send to a recipient.))

所有不使用 Gmail 的收件人都能正确接收邮件。

当我手动使用 Outlook 向此 Gmail 帐户发送邮件时,它正在工作。收件人正确接收消息。 SQL Server 邮件帐户未使用 Gmail。我使用端口 25 和 SSL(我尝试不使用 SSL,但它也不起作用)。

下面是过程调用:

EXEC msdb.dbo.sp_send_dbmail 
@recipients = 'somemail@company.com;somemail@gmail.com',
@copy_recipients = 'somemail@company.com',
@profile_name = 'my_profile',
@subject = 'mail subject',
@body = 'some content',
@body_format = 'Text';

最佳答案

我在 SSMS 中测试了 sp_send_dbmail 过程,它对于 gmail 运行良好。在消息面板上,我收到消息“邮件已排队”。您可以使用以下方法排除队列故障:msdb..sysmail_help_queue_sp @queue_type = '邮件';

对我来说,这看起来像是 smtp 邮件中继问题。您还应该测试数据库邮件配置文件设置。

关于sql-server - SQL Server sp_send_dbmail - 如何将邮件发送到 Gmail?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30529834/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com