2015-05-29 74 views
5

我使用的是sp_send_dbmail,除了當我使用Gmail帳戶發送給收件人時,這種功能是完美的。數據庫郵件日誌提供以下錯誤:SQL Server 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 = '[email protected];[email protected]', 
    @copy_recipients = '[email protected]', 
    @profile_name = 'my_profile', 
    @subject = 'mail subject', 
    @body = 'some content', 
    @body_format = 'Text'; 
+0

請給程序調用! –

+0

你好@GaborRajczi。過程調用添加... – Marc

+1

該消息似乎來自SMTP服務器,而不是DBMail。這不是DBMail問題。 – Galma88

回答

1

我測試SSMS中的sp_send_dbmail proc和它的Gmail正常工作。在消息面板上,我收到消息'郵件排隊'。 您可能會遇到以下問題: msdb..sysmail_help_queue_sp @queue_type = 'Mail' ;

對我來說,它看起來像smtp郵件中繼問題。您還應該測試數據庫郵件配置文件設置。