[英]How do I configure Windows Server 2008 R2 to allow sending of email from an Integrated Services Package in SQL Server
How do I configure Windows Server 2008 R2 to allow sending of email from an Integrated Services Package in SQL Server? 如何配置Windows Server 2008 R2以允许从SQL Server中的集成服务包发送电子邮件?
I am trying to send an email from an SSIS package that that has been imported into the MSDB stored packages. 我试图从已导入到MSDB存储包中的SSIS包中发送电子邮件。
When I run the package I get the below error: 运行程序包时,出现以下错误:
[Send Mail Task] Error: An error occurred with the following error message: "Failure sending mail. System.Net.WebException: Unable to connect to the remote server System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions
[发送邮件任务]错误:发生以下错误消息,错误:“发送邮件失败。System.Net.WebException:无法连接到远程服务器System.Net.Sockets.SocketException:尝试访问套接字以其访问权限禁止的方式
I have tried the same thing using a script task and MailMessage()
and SmtpClient()
in .NET and the task does not fail but it also does not send the email. 我已经使用脚本任务以及.NET中的
MailMessage()
和SmtpClient()
尝试了相同的操作,但该任务不会失败,但它也不会发送电子邮件。
As a sidenote: I know there is a website setup on the server through IIS that is able to send emails via port 25. 旁注:我知道服务器上有一个通过IIS的网站设置,该网站能够通过端口25发送电子邮件。
I have given the package the same host IP address and port number, but it I still get an error. 我给了程序包相同的主机IP地址和端口号,但是仍然出现错误。
Does anyone know what I can troubleshoot for finding a way to make this work? 有谁知道我可以找到解决方法来解决此问题?
Thanks 谢谢
Does the package send the email successfully when running in debug mode on your dev workstation? 在开发工作站上以调试模式运行时,程序包是否可以成功发送电子邮件? If so, then I'm guessing the SMTP server is denying the SQL Server Integration Services server permission to connect.
如果是这样,那么我猜想SMTP服务器正在拒绝SQL Server Integration Services服务器连接权限。 Perhaps the ip address of the SSIS server needs to be granted connect and/or relay permission in the SMTP product?
也许需要在SMTP产品中为SSIS服务器的IP地址授予连接和/或中继权限?
To test this, and other connectivity issues, telnet from the SSIS server to the SMTP server on port 25 ( http://support.microsoft.com/kb/153119 ). 要测试此问题以及其他连接问题,请从端口25( http://support.microsoft.com/kb/153119 )上的SSIS服务器到SMTP服务器进行telnet。
Additionally, set up Database Mail in SQL Server Database Services and test email from there. 此外,在SQL Server数据库服务中设置数据库邮件并从中测试电子邮件。 This also tests that the SMTP server allows the SSIS/MSSSQL server to connect and send mail.
这还将测试SMTP服务器是否允许SSIS / MSSSQL服务器连接和发送邮件。
Always test using both an internal email address and an external email address - that way you test relay permissions as well. 始终同时使用内部电子邮件地址和外部电子邮件地址进行测试-这样一来,您还可以测试中继权限。
The problem was that the server had changed to use something other than the default TCP port. 问题在于服务器已更改为使用默认TCP端口以外的其他端口。
The SSIS send email task only supports port 25, so I updated the script tasks and used them. SSIS发送电子邮件任务仅支持端口25,因此我更新了脚本任务并使用了它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.