aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/smtp/MCSMTPSendWithDataOperation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/async/smtp/MCSMTPSendWithDataOperation.cpp')
-rw-r--r--src/async/smtp/MCSMTPSendWithDataOperation.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/async/smtp/MCSMTPSendWithDataOperation.cpp b/src/async/smtp/MCSMTPSendWithDataOperation.cpp
index 03f6a530..4561b5d8 100644
--- a/src/async/smtp/MCSMTPSendWithDataOperation.cpp
+++ b/src/async/smtp/MCSMTPSendWithDataOperation.cpp
@@ -16,6 +16,7 @@ using namespace mailcore;
SMTPSendWithDataOperation::SMTPSendWithDataOperation()
{
mMessageData = NULL;
+ mMessageFilepath = NULL;
mFrom = NULL;
mRecipients = NULL;
}
@@ -24,6 +25,7 @@ SMTPSendWithDataOperation::~SMTPSendWithDataOperation()
{
MC_SAFE_RELEASE(mFrom);
MC_SAFE_RELEASE(mRecipients);
+ MC_SAFE_RELEASE(mMessageFilepath);
MC_SAFE_RELEASE(mMessageData);
}
@@ -37,6 +39,16 @@ Data * SMTPSendWithDataOperation::messageData()
return mMessageData;
}
+void SMTPSendWithDataOperation::setMessageFilepath(String * path)
+{
+ MC_SAFE_REPLACE_RETAIN(String, mMessageFilepath, path);
+}
+
+String * SMTPSendWithDataOperation::messageFilepath()
+{
+ return mMessageFilepath;
+}
+
void SMTPSendWithDataOperation::setFrom(Address * from)
{
MC_SAFE_REPLACE_COPY(Address, mFrom, from);
@@ -60,6 +72,10 @@ Array * SMTPSendWithDataOperation::recipients()
void SMTPSendWithDataOperation::main()
{
ErrorCode error;
+ if (mMessageFilepath != NULL) {
+ session()->session()->sendMessage(mFrom, mRecipients, mMessageFilepath, this, &error);
+ }
+ else
if ((mFrom != NULL) && (mRecipients != NULL)) {
session()->session()->sendMessage(mFrom, mRecipients, mMessageData, this, &error);
}