使用 SSIS 处理邮件正文
我正在开发一个SSIS项目,该项目主要从oracle数据库中获取数据并将其放入excel表中,并进行一些日志记录和电子邮件发送等。
现在的情况:每天通过电子邮件发送评论,并手动从outlook复制粘贴到excel文件中( oldskool)
现在,我们想要获取(整个)<'body'>电子邮件并通过 SSIS 将其插入到 Excel 中。
出现2个问题: -- 如何获取邮件本身(从交换中获取邮件?创建一个进程,在接收后将邮件保存为 html/text 文件) -- 如何“阅读”电子邮件正文(我已经找到了一些关于此的信息,问题不大,通过 C# 脚本任务读取正文标记)
提前感谢您的任何输入!
I'm working on a SSIS project that mainly fetches data from an oracle DB and puts it in excel sheets, with some logging and email-sending etc.
Situation now: comments are emailed daily and manually copy pasted from outlook into the excel files (oldskool)
Now, we'd like to fetch the (whole) <'body'> of the emails and insert that in excel via SSIS.
2 questions arise:
-- How to fetch the mail itself (fetch it from the exchange? create a process that saves the mail as a html/text file after receiving)
-- How to 'read' the body of the email (I already found some info on this, less of a problem, via a C# script task read the body tag)
Thanks in advance for any input!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使用第 3 方组件才能从 Exchange 读取消息。
最好尝试使用脚本任务来访问 Exchange(看看这个 问题)。这样您就可以访问 Exchange 邮箱并将主题、发件人、收件人、抄送、密件抄送和正文放在管道中的单独列中。不要忘记连接到 Exchange 需要 Windows 帐户,这样您的程序包必须由拥有邮箱的用户运行。或者您可以在脚本任务中模拟他。
由于这是一项艰巨的任务,您认为最好创建一个简单的应用程序来读取邮件并将其存储在数据库中,以便您可以使用 SSIS 轻松检索它们。
You have to use 3rd party components to read messages from Exchange.
It's better to try Script Task to access Exchange (take a look at this question). This way You can access exchange mailbox and put subject, from, to, cc, bcc and body in separate columns in pipeline. Don't forget that connecting to Exchange requires windows account and that way your package must be run by user who owns mailbox. Or You can impersonate him in Script Task.
Since this is quite a task, U guess it would be better to create simple application that will read mails and store them in database so You can retrieve them easily with SSIS.