diff options
Diffstat (limited to 'framework/mail/composer.cpp')
-rw-r--r-- | framework/mail/composer.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/framework/mail/composer.cpp b/framework/mail/composer.cpp index 1ec56347..4ef112fa 100644 --- a/framework/mail/composer.cpp +++ b/framework/mail/composer.cpp | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "composer.h" | 21 | #include "composer.h" |
22 | #include <actions/context.h> | 22 | #include <actions/context.h> |
23 | #include <actions/action.h> | 23 | #include <actions/action.h> |
24 | #include <settings/settings.h> | ||
24 | #include <KMime/Message> | 25 | #include <KMime/Message> |
25 | #include <KCodecs/KEmailAddress> | 26 | #include <KCodecs/KEmailAddress> |
26 | #include <QVariant> | 27 | #include <QVariant> |
@@ -127,12 +128,18 @@ void Composer::send() | |||
127 | mail->subject(true)->fromUnicodeString(m_subject, "utf-8"); | 128 | mail->subject(true)->fromUnicodeString(m_subject, "utf-8"); |
128 | mail->setBody(m_body.toUtf8()); | 129 | mail->setBody(m_body.toUtf8()); |
129 | mail->assemble(); | 130 | mail->assemble(); |
131 | |||
132 | Kube::ApplicationContext settings; | ||
133 | auto account = settings.currentAccount(); | ||
134 | auto identity = account.primaryIdentity(); | ||
135 | auto transport = identity.transport(); | ||
136 | |||
130 | Kube::Context context; | 137 | Kube::Context context; |
131 | context.setProperty("message", QVariant::fromValue(mail)); | 138 | context.setProperty("message", QVariant::fromValue(mail)); |
132 | //TODO get from somewhere | 139 | |
133 | context.setProperty("username", QVariant::fromValue(QByteArray("test@test.com"))); | 140 | context.setProperty("username", transport.username()); |
134 | context.setProperty("password", QVariant::fromValue(QByteArray("pass"))); | 141 | context.setProperty("password", transport.password()); |
135 | context.setProperty("server", QVariant::fromValue(QByteArray("smtp://smtp.gmail.com:587"))); | 142 | context.setProperty("server", transport.server()); |
136 | 143 | ||
137 | Kube::Action("org.kde.kube.actions.sendmail", context).execute(); | 144 | Kube::Action("org.kde.kube.actions.sendmail", context).execute(); |
138 | clear(); | 145 | clear(); |