diff --git a/src/mimemessage.cpp b/src/mimemessage.cpp index ea57cf4..bb64906 100644 --- a/src/mimemessage.cpp +++ b/src/mimemessage.cpp @@ -61,6 +61,7 @@ void MimeMessage::setContent(MimePart *content) { void MimeMessage::setSender(EmailAddress* e) { this->sender = e; + e->setParent(this); } void MimeMessage::addRecipient(EmailAddress* rcpt, RecipientType type) @@ -77,6 +78,8 @@ void MimeMessage::addRecipient(EmailAddress* rcpt, RecipientType type) recipientsBcc << rcpt; break; } + + rcpt->setParent(this); } void MimeMessage::addTo(EmailAddress* rcpt) { diff --git a/src/smtpclient.cpp b/src/smtpclient.cpp index 43b6741..afa4e87 100644 --- a/src/smtpclient.cpp +++ b/src/smtpclient.cpp @@ -364,6 +364,7 @@ bool SmtpClient::sendMail(MimeMessage& email) // To (primary recipients) for (it = email.getRecipients().begin(), itEnd = email.getRecipients().end(); it != itEnd; ++it) + { sendMessage("RCPT TO:<" + (*it)->getAddress() + ">"); waitForResponse();