是否可以使用 VBA 获取 Gmail 电子邮件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21342902/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to fetch gmail emails using VBA?
提问by DeBoer
I'm trying to drop Outlook from my MS Access application. The main problem is to fetch emails from my gmail account and for example delete it or read the body etc. I know I can use CDO to send email from VBA using my gmail account, but is it possible to get my inbox using VBA?
我正在尝试从我的 MS Access 应用程序中删除 Outlook。主要问题是从我的 gmail 帐户中获取电子邮件,例如删除它或阅读正文等。我知道我可以使用 CDO 使用我的 gmail 帐户从 VBA 发送电子邮件,但是是否可以使用 VBA 获取我的收件箱?
Thanks.
谢谢。
回答by DeBoer
I have found the solution. There is a library you can use to fetch emails from using IMAP or POP3 protocol via VBA http://emailarchitect.net/eagetmail/kb/vb.aspx
我找到了解决办法。有一个库可用于通过 VBA http://emailarchitect.net/eagetmail/kb/vb.aspx使用 IMAP 或 POP3 协议获取电子邮件
回答by E.H
You would need some type of intermediate API call, such as an SMTP service, in order to accomplish this task. You would then be able to setup a CDO object through which to read/write messages.
您需要某种类型的中间 API 调用,例如 SMTP 服务,才能完成此任务。然后,您将能够设置一个 CDO 对象,通过它来读/写消息。