【发布时间】:2017-10-26 21:21:45
【问题描述】:
当我尝试使用 Poco 库构建电子邮件客户端时。我发现我无法使用以下方法检索内容。
for ( auto i = messages.begin(); i != messages.begin()+10; ++i )
{
MessageHeader header;
session.retrieveHeader((*i).id, header);
std::cout << "Subject:" << header.get("Subject");
std::cout << "Content" << header.get("Content");
/// Can't perform the above because there are no "Content:" in the
/// RFC2822.
}
///example in the RFC 2882
----
From : John Doe <jdoe@machine(comment). example>
To : Mary Smith
__
<mary@example.net>
Subject : Saying Hello
Date : Fri, 21 Nov 1997 09(comment): 55 : 06 -0600
Message-ID : <1234 @ local(blah) .machine .example>
This is a message just to say hello.
So, "Hello".
----
MessageHeader 的父类“Poco/Net/NameValueCollection”也没有提供检索邮件内容的方法。
const std::string& NameValueCollection::get(const std::string& name)
{
ConstIterator it = _map.find(name);
if (it != _map.end())
return it->second;
else
throw NotFoundException(name);
}
所以,我的问题是:还有其他方法可以使用 poco 库检索 gmail 消息吗?
【问题讨论】:
标签: c++ email gmail poco-libraries