通过 SQL Server 发送电子邮件失败 [英] Sending Email through SQL Server FAILED

查看:53
本文介绍了通过 SQL Server 发送电子邮件失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 SQL Server 2008 中设置数据库邮件,以将邮件发送到我的 Gmail 帐户.以下是我创建的 DBMail 配置文件的详细信息:

I am setting up Database mail in SQL Server 2008 to send mail to my Gmail account. Following are the details of the DBMail profile I've created:

email id : xyz@gmail.com
Display Name : xyz
Reply email :
Server name : smtp.gmail.com
port no: 587
Check : This server requires a secure connection
Check : Basic Authentication
username : xyz@gmail.com ( should have gmail.com)
password : <mypassword>
confirm password : <mypassword>

然后我点击了下一步并将其设为默认公开个人资料.

Then I clicked next and also made it default public profile.

然后我使用下面的TSQL代码来配置和发送DBMail:

Then I use the following TSQL code to configure and send DBMail:

EXEC sp_CONFIGURE 'show advanced', 1
GO
RECONFIGURE
GO
EXEC sp_CONFIGURE 'Database Mail XPs', 1
GO
RECONFIGURE
GO

use msdb
go
EXEC sp_send_dbmail 
@profile_name='XYZ',
@recipients='XYZr@gmail.com',
@subject='Test message',
@body='Message Sent Successfully'

The output appears "Message Queued"

我的消息仍然失败.我觉得我已经正确设置了服务器.任何输入将不胜感激.

Still my message is getting failed. I feel I have setup the server correctly. Any input would be appreciated.

 SELECT * FROM sysmail_log

正文栏显示

由于邮件服务器故障,邮件无法发送给收件人.(使用帐户 1 发送邮件(2012-05-16T17:05:00).异常消息:无法连接到邮件服务器.(否)这样的主机是已知的.)"

"The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2012-05-16T17:05:00). Exception Message: Could not connect to mail server. (No such host is known). )"

推荐答案

一些建议的故障排除步骤:

Some suggested troubleshooting steps:

  1. 尝试通过相同的 SMTP 服务器发送消息,使用与 SQL Server 相同的机器,使用客户端邮件程序(如 Outlook).您可能会收到更有意义的错误消息.

  1. Try to send a message through the same SMTP server, using the same machine as SQL Server, using a client mail program like Outlook. You may get a more meaningful error message.

端口可能被阻塞.尝试使用端口 587 将邮件发送到任何其他 SMTP 服务器.

The port may be blocked. Try sending mail to any other SMTP server using port 587.

尝试更改为端口 465.

Try changing to port 465.

尝试在您的个人资料中取消选中需要安全连接"位.

Try unchecking the "requires a secure connection" bit in your profile.

尝试使用网络内的 SMTP 服务器中继到 GMail.这可能更容易设置和运行.如果没有可用于处理中继的本地 SMTP 服务器,则需要安装 IIS 和 SMTP 组件.

Try using an SMTP server inside your network to relay to GMail. This might be easier to set up and get running. You'll need to install IIS and the SMTP components if you don't have a local SMTP server available to handle the relay.

查看http://mail.google.com/support/bin/answer.py?hl=zh-CN&answer=13287

这篇关于通过 SQL Server 发送电子邮件失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆