- Get emails from accounts, account info (username, password, saveBody, saveAttachments) can be obtained from EmailInboundConfig object
- Retrieve subject, each attachment's filename
After comparing 3 open source C++ email handling libraries, I've decided to give POCO library a go. Remember to include the following in the header (*.h) files.
#include "Poco/Net/POP3ClientSession.h"
#include "Poco/Net/MailMessage.h"
#include "Poco/Net/PartHandler.h"
#include "Poco/Net/MessageHeader.h"
#include "Poco/Net/NameValueCollection.h"
#include "Poco/Net/QuotedPrintableDecoder.h"
#include "Poco/Net/MultipartReader.h"
#include "Poco/Exception.h"
#include "Poco/StreamCopier.h"
#include "Poco/Base64Decoder.h"
#include <iostream>
#include <fstream>
Hi, Which library do you include to use String::TakeField method ?
ReplyDeleteHi @MaKay, it's actually a custom function. I've just included it in the post.
ReplyDeleteThanks your reply, JustinW. What is the functionality of String::FixField method ? Or can you post all source of custom String class ?
ReplyDeleteThanks the source of String class, JustinW. Currently I've read Service.cpp file, I see that you used 2 methods: MyMailMessage::write() and MyMailMessage::isMultipart(), I don't understand internally the purpose of these methods. Can you post the source of MyMailMessage class ?
ReplyDeleteHi @MaKay, sorry for the confusion. MyMailMessage class is actually an extension of the POCO library class, MailMessage. I will include MyMailMessage header file for you to refer.
ReplyDeleteIt clear me now, thanks JustinW.
ReplyDeleteIn ProcessEmail member function of Service class, you haven't saved file attachments to somewhere in local, have you? And if email's file attachments are binary format (word, excel, pdf), how can you save them ?
ReplyDeleteFile::Copy(outputBodyPath,creatorFilePath) will copy any attachment found in email to local server file directory.
ReplyDeleteThanks JustinW.
ReplyDeleteCould you please add MyPartHandler.h also!?
ReplyDeleteDidn't you have this problem? https://github.com/pocoproject/poco/issues/160
ReplyDeleteHi Jochen,
DeleteSorry, I haven't encountered this issue before. Which email client software are you using? As I know, there're a few different email standards out there that we need to deal with. I've been testing it using Outlook Express, Yahoo and Gmail.
Hi, can you post Directory.h, too please - and Dircetory.cpp if there is one - this is looking like an awesome piece of code. Thanks!
ReplyDeleteHi tumnus,
DeleteIt's my mistake to include Directory headers in there, I don't think any function is using Directory class. Please correct me if I'm wrong.
This comment has been removed by the author.
ReplyDeleteHi, kannst Du kurz erklären, wom man die Dateien für #include iconv.h" herbekommt?
ReplyDeleteAuf Win7 und VS2010 ist nichts dazu zu finden
THX.
Jammin' Jars Casino and Resort - KTH
ReplyDeleteJAMMIN' JARS is a hotel and casino located in 경주 출장마사지 Las Vegas, Nevada. The Jammin Jars Casino & Resort 서산 출장샵 is located 인천광역 출장안마 in 과천 출장마사지 the 경상남도 출장마사지 center of the Las Vegas Strip, a