2017-10-05 29 views
0

正如我試圖使用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消息?

回答

0

我在poco github頁面上發佈了這個問題。 的效應初探是:

///////////

有沒有我可以檢索Gmail郵件的其他方式?

是,MAILMESSAGE與::的getContent()

///////////

而且它沒有解決我的問題。

相關問題