Created
May 13, 2016 10:23
-
-
Save fake666/71a7ff496edffe0ca7b362ef7552114e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <mimetic/mimetic.h> | |
using namespace std; | |
using namespace mimetic; | |
string testMessage = "Content-Type: multipart/mixed;\r\n\ | |
boundary=\"_1_\"\r\n\ | |
\r\n\ | |
--_1_\r\n\ | |
Content-Type: text/plain\r\n\ | |
\r\n\ | |
this is your attachment\r\n\ | |
\r\n\ | |
--_1_\r\n\ | |
Content-Type: message/rfc822\r\n\ | |
Content-Disposition: attachment\r\n\ | |
\r\n\ | |
RFC822 attachement body\r\n\ | |
\r\n\ | |
--_1_--\r\n"; | |
int main(int argc, char** argv) { | |
MimeEntity me(testMessage.begin(), testMessage.end()); | |
MimeEntity* rfc822part = &*me.body().parts().back(); | |
rfc822part->body().set("changed body"); | |
rfc822part->body().parts().clear(); | |
cout << *rfc822part << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment