我正在尝试使用以下代码从SQL Server发送电子邮件:
EXEC msdb.dbo.sp_send_dbmail @profile_name='Notif Sender',
@recipients = 'example@example.com',
@copy_recipients ='example2@example.com',
@blind_copy_recipients='example3@example.com',
@subject = 'TEST Message',
@body = '<h4>TEST BODY</h4>',
@body_format = 'HTML';
我已经配置了数据库邮件,并且同时具有公开和默认配置文件&#39; Notif Sender&#39;。
但是邮件程序无法连接到smtp服务器。
可能是什么问题?
我认为我需要设置本地网络的代理服务器,所以我在IE的Internet选项中设置它,但它没有帮助。代理服务器在那里正确设置,因为我可以毫无问题地上网。
以下是日志文件中的一行:
11/10/2014 15:52:04,,Error,52,
The mail could not be sent to the recipients because of the mail server failure.
(Sending Mail using Account 2 (2014-11-10T15:52:04).
Exception Message: Could not connect to mail server.
(A connection attempt failed because the connected party did not properly respond after a period of time<c/>
or established connection failed because connected host has failed to respond 64.233.162.109:587).<nl/>),
3672,23,,10.11.2014 15:52:04,sa