使用Gmail上下文小工具访问附件
-
18-09-2020 - |
题
我想将电子邮件与附件一起从Gmail(Google Apps)到另一个数据库中的CRM样功能。但是,根据 docs ,“提取器无法读取电子邮件附件”。我的问题:有可能以某种方式使用来自电子邮件的某些类型的标识符(例如EmameTimeExtractor),并使用它使用IMAP拉动附件吗?我不是很熟悉上下文小工具,只是想知道我在潜水前我想要做什么!
解决方案
如果使用标准的IMAP客户端将电子邮件向下拉,您将获得附件。它将是其中一个部分。psiedo代码:
email = new->email_object();
remote_mailbox = new->imap_object_creator(username, password, ...)
while (email = remote_mailbox->download_next_email) { // this downloads the next email
foreach part_type (email->parts->next) { // this iterates over the parts of the email
if( part_type == 'attachment' ) { // not sure if this is it exactly, but you'll find it in the mime-type
//hooray! you've found an attachment. do what you will with it
}
}
}
.
当我这样做时,我在perl中写它,所以我用mime ::工具套件将电子邮件和imap :: client作为我的IMAP客户端。但是任何语言都应该具有可用于表示IMAP连接和电子邮件的常见对象。
其他提示
我相信附件..正是这一点 - 这有帮助,还是你的需要仍然是未满足的?
应该从提取器获取电子邮件ID,然后使用Google Apps Script Gmailattachment对象获取附件。
不隶属于 StackOverflow