使用发送邮件任务时 SSIS 包显示错误 [英] SSIS package displays an error when I use send mail task

查看:31
本文介绍了使用发送邮件任务时 SSIS 包显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含使用 SEND MAIL 任务的任务的包,但它执行良好,直到它接近发送邮件任务并显示错误.这是 [发送邮件任务] 错误:出现以下错误消息:语法错误,无法识别命令.服务器响应为:5.0.0 您的电子邮件系统必须在发送邮件前进行身份验证

I have a package with a task used SEND MAIL Task, but its executing fine till it approach to send mail task and display an error. Which is [Send Mail Task] Error: An error occurred with the following error message: "Syntax error, command unrecognized. The server response was: 5.0.0 Your email system must authenticate before sending mail

推荐答案

您尝试使用的邮件服务器在接收邮件之前需要进行身份验证.

The mail server you're trying to use requires authentication before it will receive messages.

SSIS 的 SMTP 连接管理器仅限于支持 Windows 身份验证.如果您使用的是网络内部的基于 Windows 的邮件服务器(例如 Microsoft Exchange Server),则这种形式的身份验证可能会起作用.但是,听起来您的服务器需要使用用户名和密码进行身份验证.SSIS 不支持开箱即用.

SSIS's SMTP connection manager is limited to supporting Windows authentication. This form of authentication might work if you were using a Windows-based mail server internal to your network (say, a Microsoft Exchange Server). However, it sounds like your server requires authentication with a username and password. SSIS doesn't support this out of the box.

  • 请您的邮件服务器运营商将您的 SSIS 服务器的 IP 地址列入白名单,以便邮件服务器在从该 IP 接收消息时不需要身份验证.此选项允许您使用 SSIS 的内置发送邮件任务.
  • 在您的 SSIS 服务器上设置 SMTP 中继服务器.将中继配置为仅接受本地连接(防止其他计算机通过您的系统发送垃圾邮件)并将所有邮件转发到您要使用的外部 SMTP 服务器.(当然,中继需要支持与远程 SMTP 服务器的身份验证.)此选项还允许您继续使用 SSIS 的内置发送邮件任务.
  • 正如@Justin 提到的,创建一个执行发送的脚本任务.您可以使用 .Net 的 SmtpClient 类,支持用户名/密码验证,用于发送消息.
  • 使用第三方 SSIS 组件.我没有尝试过,所以我无法提出建议,但搜索ssis smtp 组件"出现了选项.
  • 如果您有权访问 Microsoft SQL Server,则使用调用 sp_send_dbmail 的执行 SQL 任务可能会起作用.SQL Server 的数据库邮件支持基本身份验证和 SSL.
  • Ask your mail server operator to white list your SSIS server's IP address so that the mail server doesn't require authentication when messages are received from that IP. This option allows you to use SSIS's built-in Send Mail Task.
  • Set up a SMTP relay server on your SSIS server. Configure the relay to only accept local connections (preventing other computers from sending SPAM through your system) and to forward all messages to the external SMTP server you want to use. (Of course, the relay needs to support authenticating with the remote SMTP server.) This option also allows you to keep using SSIS's built-in Send Mail Task.
  • As @Justin mentions, create a script task that does the sending. You could use .Net's SmtpClient class, which supports username/password authentication, to send the message.
  • Use a third-party SSIS component. I've not tried any so I can't make recommendation but searching for "ssis smtp component" turned up options.
  • If you have access to a Microsoft SQL Server, using an Execute SQL Task that calls sp_send_dbmail might work. SQL Server's Database Mail supports basic authentication and SSL.

这篇关于使用发送邮件任务时 SSIS 包显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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