Skip to content

Instantly share code, notes, and snippets.

@fake666
Created May 13, 2016 10:23
Show Gist options
  • Save fake666/71a7ff496edffe0ca7b362ef7552114e to your computer and use it in GitHub Desktop.
Save fake666/71a7ff496edffe0ca7b362ef7552114e to your computer and use it in GitHub Desktop.
#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