-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
55 lines (35 loc) · 1.17 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <gmimepp.hpp>
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
//while(true)
//{
GmimePP gpp(argv[1]);
gpp.init();
cout << "From: " << gpp.getHeader("FROM") << endl;
cout << "To: " << gpp.getHeader("To") << endl;
cout << "Subject: " << gpp.getHeader("Subject") << endl;
cout << "Message-ID: " << gpp.getHeader("Message-ID") << endl;
gpp.addHeader("header1", "value1");
gpp.setHeader("header1", "value2");
std::vector<SHeaderValue> allrcpts;
gpp.getAllRecipients(allrcpts);
for (auto &rcpt : allrcpts)
cout << "allrcpt" << rcpt.name << "-" << rcpt.value << endl;
allrcpts.clear();
/*
GMIME_RECIPIENT_TYPE_TO,
GMIME_RECIPIENT_TYPE_CC,
GMIME_RECIPIENT_TYPE_BCC
*/
gpp.getRecipientsByType(GMIME_RECIPIENT_TYPE_TO, allrcpts);
for (auto &rcpt : allrcpts)
cout << "rcptbytype" <<rcpt.name << "-" << rcpt.value << endl;
cout << gpp.getFromAdress() << endl;
//getchar();
//sleep(0.1);
//}
//gpp.saveAttachments("/home/iyasar/gmimetest/GmimePlusPlus");
return 0;
}