如何自动从日常电子邮件附件获取脚本处理的文件?
背景:每个工作日我都会收到供应商发来的电子邮件,他们向我发送了一个 CSV 文件作为附件。 CSV 文件需要转换为 HTML,我已经有一个脚本可以执行此操作。
问题是,我必须手动打开电子邮件,将附件保存到硬盘,然后针对保存的附件运行脚本。我想自动完成这一切,因为它变得乏味。
我总是必须将电子邮件附件保存到某个文件系统上某处的已知文件路径,然后针对该已知文件路径运行脚本,将其转换为不同的格式以用于报告目的。
问题:假设我可以将电子邮件和附件转发到任何地方,我如何才能自动执行此过程?是否有某种 SMTP 到 SCP 网关?如何自动将电子邮件附件转换为文件系统上具有已知路径的文件,以便可以通过脚本对其进行处理?
Background: Every work day I get an e-mail from a vendor who sends me a CSV file as an attachment. The CSV file needs to be converted into HTML and I already have a script that does that.
The problem is, I have to manually open my e-mail, save the attachment to my hard drive and then run the script against the saved attachment. I would like to do this all automatically because it is getting tedious.
I always have to save the e-mail attachment to a known file path on some file system somewhere and then run a script against that known file path to convert it to a different format for reporting purposes.
Question: Assuming I can forward the e-mail and attachment anywhere, how can I automate this process? Is there some kind of SMTP to SCP gateway? How does one automatically go about converting e-mail attachments into files with known paths on a filesystem so they can be processed via script?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我发现的两篇文章,在某些条件下可以在 VBScript 中完成此操作。我不会在这里深入探讨,而是为您提供以下文章:
http://www .example-code.com/vbscript/emailObject_saveAttachments.asp
http://www.devnewsgroups.net/group/microsoft.public.exchange.development/topic32825.aspx
According to two articles I found, this can be done in VBScript uncer certain conditions. Rather than go in depths here, I'll give you the articles:
http://www.example-code.com/vbscript/emailObject_saveAttachments.asp
http://www.devnewsgroups.net/group/microsoft.public.exchange.development/topic32825.aspx