diff options
Diffstat (limited to 'examples/mailtransportresource/smtptest.cpp')
-rw-r--r-- | examples/mailtransportresource/smtptest.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/mailtransportresource/smtptest.cpp b/examples/mailtransportresource/smtptest.cpp new file mode 100644 index 0000000..079150f --- /dev/null +++ b/examples/mailtransportresource/smtptest.cpp | |||
@@ -0,0 +1,20 @@ | |||
1 | |||
2 | #include <QCoreApplication> | ||
3 | #include <KMime/Message> | ||
4 | #include "mailtransport.h" | ||
5 | |||
6 | int main(int argc, char *argv[]) | ||
7 | { | ||
8 | QCoreApplication app(argc, argv); | ||
9 | app.setApplicationName(argv[0]); | ||
10 | |||
11 | auto args = app.arguments(); | ||
12 | |||
13 | auto msg = KMime::Message::Ptr::create(); | ||
14 | msg->to(true)->from7BitString("doe2@example.org"); | ||
15 | msg->from(true)->from7BitString("doe@example.org"); | ||
16 | msg->subject(true)->from7BitString("Subject"); | ||
17 | msg->assemble(); | ||
18 | |||
19 | MailTransport::sendMessage(msg, "smtp://kolab:25", "doe@example.org", "Welcome2KolabSystems", QByteArray{}, MailTransport::Options{}); | ||
20 | } | ||