diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-01-25 14:43:07 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-01-25 14:43:07 +0100 |
commit | 31dbe72afb5e04cd86d4f107e7257fb60aaa087b (patch) | |
tree | 9df6ad125f80d74fb720a1994415c0c279c5f902 /examples/mailtransportresource/mailtransportresource.cpp | |
parent | 102bb38ed89da2295a01d707db954e47a6cb8d7d (diff) | |
download | sink-31dbe72afb5e04cd86d4f107e7257fb60aaa087b.tar.gz sink-31dbe72afb5e04cd86d4f107e7257fb60aaa087b.zip |
Do the logging in the resource code.
Diffstat (limited to 'examples/mailtransportresource/mailtransportresource.cpp')
-rw-r--r-- | examples/mailtransportresource/mailtransportresource.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/mailtransportresource/mailtransportresource.cpp b/examples/mailtransportresource/mailtransportresource.cpp index 1d90adf..516ff8e 100644 --- a/examples/mailtransportresource/mailtransportresource.cpp +++ b/examples/mailtransportresource/mailtransportresource.cpp | |||
@@ -129,8 +129,12 @@ public: | |||
129 | if (settings.server.contains("smtps")) { | 129 | if (settings.server.contains("smtps")) { |
130 | options |= MailTransport::UseTls; | 130 | options |= MailTransport::UseTls; |
131 | } | 131 | } |
132 | if (!MailTransport::sendMessage(msg, settings.server.toUtf8(), settings.username.toUtf8(), secret().toUtf8(), settings.cacert.toUtf8(), options)) { | 132 | |
133 | SinkWarning() << "Failed to send message: " << mail; | 133 | SinkLog() << "Sending message " << settings.server << settings.username << "CaCert: " << settings.cacert; |
134 | SinkTrace() << "Sending message " << msg; | ||
135 | auto result = MailTransport::sendMessage(msg, settings.server.toUtf8(), settings.username.toUtf8(), secret().toUtf8(), settings.cacert.toUtf8(), options); | ||
136 | if (!result.error) { | ||
137 | SinkWarning() << "Failed to send message: " << mail << "\n" << result.errorMessage; | ||
134 | emitNotification(Notification::Warning, ApplicationDomain::SyncError, "Failed to send message.", {}, {mail.identifier()}); | 138 | emitNotification(Notification::Warning, ApplicationDomain::SyncError, "Failed to send message.", {}, {mail.identifier()}); |
135 | emitNotification(Notification::Warning, ApplicationDomain::TransmissionError, "Failed to send message.", {}, {mail.identifier()}); | 139 | emitNotification(Notification::Warning, ApplicationDomain::TransmissionError, "Failed to send message.", {}, {mail.identifier()}); |
136 | return KAsync::error("Failed to send the message."); | 140 | return KAsync::error("Failed to send the message."); |