我写了一个AppleScript来备份我所有的邮件。我已经将很多电子邮件保存为本地硬盘上的.eml文件,并将它们从服务器上删除。是否有方法以.eml文件作为消息加载AppleScript,以获取发送的日期、主题等?
发布于 2011-10-15 22:07:47
像这样的事怎么样:
set fromField to text 7 thru -1 of (do shell script "cat /test.eml | grep From:")
set dateField to text 7 thru -1 of (do shell script "cat test.eml | grep Date:")
set toField to text 5 thru -1 of (do shell script "cat /test.eml | grep To:")
set subjectField to text 10 thru -1 of (do shell script "cat /test.eml | grep Subject:")身体有点困难,因为你需要决定你是否只想要电子邮件身体,还是所有以前的电子邮件嵌入身体。下面是我测试邮件的正文。
set temp to do shell script "cat /test.eml"
set text item delimiters to "--"
set temp2 to (text item 3 of temp)
set text item delimiters to "
"
set messageField to paragraphs 6 thru -1 of temp2 as text如果使用其他字符,请确保注意文件的编码。
https://stackoverflow.com/questions/7780851
复制相似问题