无法使用Poco库检索电子邮件内容
问题描述:
正如我试图使用Poco库建立电子邮件客户端一样。我发现我无法使用以下方法检索内容。无法使用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 <[email protected](comment). example>
To : Mary Smith
__
<[email protected]>
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".
----
而且也是“波苏/网/ NameValueCollection中”,这是父类的MessageHeader不提供检索电子邮件内容的方法。
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消息?
答
我在poco github页面上发布了这个问题。 的效应初探是:
///////////
有没有我可以检索Gmail邮件的其他方式?
是,MAILMESSAGE与::的getContent()
///////////
而且它没有解决我的问题。