If you attempt to save a mail message to a file using the RWStreamCoupler mechanism, use the pop3StreamFilter global function. You can find its declaration in the pop3.h header file as the filter of the RWStreamCoupler::operator() method. This filter indicates an end-of-data (mail) condition on a POP3 input stream, as shown in the following example.
RWPop3DataReply reply; reply = client.retr(1); // retrieve the first message RWPortalIStream istr(reply.portal()); // construct an input stream ofstream ostr("save.me"); // construct an output stream in save.me RWStreamCoupler couple; couple(istr, ostr, pop3StreamFilter); |
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.