当我使用此代码时尝试从sql server发送电子邮件
exec msdb.dbo.sp_send_dbmail
@recipients='yang.liu@hotmail.com',
@body= 'abc',
@subject = 'new request',
@profile_name ='thisProfile'
sql server management show me:邮件排队。
但实际上,当我查看日志以查看原因时,此电子邮件尚未发送:
SELECT TOP 100 [log_id]
,[event_type]
,[log_date]
,[description]
,[process_id]
,[mailitem_id]
,[account_id]
,[last_mod_date]
,[last_mod_user]
FROM [msdb].[dbo].[sysmail_event_log]
order by [log_id] desc
日志告诉我:
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2014-07-10T10:34:17). Exception Message: Could not connect to mail server. (The requested name is valid, but no data of the requested type was found).
任何人都可以告诉我是什么原因,谢谢