简体   繁体   English

将 .eml 导入我的 Gmail 收件箱的 Google Apps 脚本

[英]Google Apps Script to import .eml into my Gmail Inbox

I have several hundred .eml files in GDrive that I would like to import into my Gmail as emails.我在 GDrive 中有数百个 .eml 文件,我想将它们作为电子邮件导入到我的 Gmail 中。 Can anyone suggest a Google Apps Script that will let me do this?任何人都可以建议让我这样做的 Google Apps 脚本吗? I am fairly proficient in Google Apps Script, I just need some hints as to how to proceed.我对 Google Apps Script 相当精通,我只需要一些关于如何继续的提示。

I know this thread is a bit old, but I came across a way to import single (or multiple) eml files into Gmail today and thought I'd share.我知道这个线程有点旧,但我今天遇到了一种将单个(或多个)eml 文件导入 Gmail 的方法,并认为我会分享。 My use case is that my company migrated to Google Apps and imported my email into a gmail account.我的用例是我的公司迁移到 Google Apps 并将我的电子邮件导入到 gmail 帐户。 I had previously been using Pop3 to pull those emails into another gmail account to make use of the gmail interface.我以前一直在使用 Pop3 将这些电子邮件拉入另一个 gmail 帐户以使用 gmail 界面。 Unfortunately my sent mails did not get put back into my corporate email sent folder and therefore did not get imported into the new gmail account.不幸的是,我发送的邮件没有放回我的公司电子邮件发送文件夹,因此没有导入到新的 Gmail 帐户中。 Here is how I got my sent email into the new Google Apps gmail account.以下是我将发送的电子邮件发送到新的 Google Apps gmail 帐户的方法。

Download a copy of Gmail Backup from here .此处下载 Gmail 备份副本。 I used it to backup the entire contents of a gmail account.我用它来备份 gmail 帐户的全部内容。 Enter your gmail credentials and give it a folder to download into and it goes off to work.输入您的 Gmail 凭据并为其提供一个文件夹以供下载,然后它就可以开始工作了。 It sorts the emails into single eml files and uses month and year folders.它将电子邮件分类为单个 eml 文件并使用月份和年份文件夹。 The folder structure is MyGmailBackup (folder) 2012 10 - October 2012 eml files are in here.文件夹结构是 MyGmailBackup(文件夹)2012 年 10 月 - 2012 年 10 月 eml 文件在这里。 11 - November 2012 eml files are in here. 2012 年 11 月 11 日至 11 月的 eml 文件在这里。 12 2013 01 02 12 2013 01 02

It has a restore option that is very helpful for importing into Gmail.它有一个还原选项,对于导入 Gmail 非常有帮助。 Using the same Gmail Backup program I changed the credentials to the gmail account I wanted to restore emails into.使用相同的 Gmail 备份程序,我将凭据更改为要恢复电子邮件的 Gmail 帐户。 If I had wanted to import all the emails I could have set the folder to MyGmailBackup.如果我想导入所有电子邮件,我可以将文件夹设置为 MyGmailBackup。 I only wanted to import some of the emails so I created a folder for holding the emails I wanted to import into the second gmail account.我只想导入一些电子邮件,所以我创建了一个文件夹来保存我想导入到第二个 gmail 帐户的电子邮件。 I then dropped a single eml file into the folder and hit Restore.然后我将一个 eml 文件放入文件夹并点击恢复。 Upon refreshing my gmail in my browser my email was there.在浏览器中刷新我的 gmail 后,我的电子邮件就在那里。 It even threaded properly.它甚至正确穿线。 I then selected multiple eml files I wanted to restore and tried it again.然后我选择了多个我想要恢复的 eml 文件并再次尝试。 It worked perfectly.它工作得很好。 Now I have my sent email in their threads and am back in business where I left off.现在,我在他们的主题中收到了我发送的电子邮件,并在我离开的地方重新开始工作。 Hope this helps someone out.希望这可以帮助某人。

Use ImportExportTools addon in Thunder Bird.在 Thunder Bird 中使用ImportExportTools插件。 With in seconds you can import eml files to thunderbird by pointing to the folder which contains eml files.在几秒钟内,您可以通过指向包含 eml 文件的文件夹将 eml 文件导入到 Thunderbird。 And if you have added gmail to thunderbird, gmail will do sync within no time.如果您已将 gmail 添加到雷鸟,gmail 将立即进行同步。

I'm not sure of the format of an .eml file, but for Lotus Notes, I could import an exported "Structured Text File" using the code I've linked to here .我不确定 .eml 文件的格式,但对于 Lotus Notes,我可以使用链接到此处的代码导入导出的“结构化文本文件”。

StackOverflow didn't do a good job importing hundreds of line of code - or maybe I just did it wrong... either way.. hope this helps. StackOverflow 没有很好地导入数百行代码 - 或者我可能只是做错了......无论如何......希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM