diff --git a/src/mimeattachment.cpp b/src/mimeattachment.cpp index ce17a72..92c9399 100644 --- a/src/mimeattachment.cpp +++ b/src/mimeattachment.cpp @@ -35,7 +35,7 @@ MimeAttachment::~MimeAttachment() void MimeAttachment::prepare() { - this->header += "Content-disposition: attachment\n"; + this->header += "Content-disposition: attachment\r\n"; /* !!! IMPORTANT !!! */ MimeFile::prepare(); diff --git a/src/mimeinlinefile.cpp b/src/mimeinlinefile.cpp index 020252e..dde7688 100644 --- a/src/mimeinlinefile.cpp +++ b/src/mimeinlinefile.cpp @@ -38,7 +38,7 @@ MimeInlineFile::~MimeInlineFile() void MimeInlineFile::prepare() { - this->header += "Content-Disposition: inline\n"; + this->header += "Content-Disposition: inline\r\n"; /* !!! IMPORTANT !!! */ MimeFile::prepare(); diff --git a/src/mimemessage.cpp b/src/mimemessage.cpp index 2f806a9..2be4fab 100644 --- a/src/mimemessage.cpp +++ b/src/mimemessage.cpp @@ -107,7 +107,7 @@ QString MimeMessage::toString() mime += " " + sender->getName(); } } - mime += " <" + sender->getAddress() + ">\n"; + mime += " <" + sender->getAddress() + ">\r\n"; /* ---------------------------------- */ @@ -131,7 +131,7 @@ QString MimeMessage::toString() mime += " " + (*it)->getName(); } } - mime += " <" + (*it)->getAddress() + ">\n"; + mime += " <" + (*it)->getAddress() + ">\r\n"; } /* ---------------------------------- */ @@ -151,12 +151,12 @@ QString MimeMessage::toString() } /* ---------------------------------- */ - mime += "\n"; + mime += "\r\n"; QString boundary = "----MIME-part-boundary=" + QByteArray().append(QDateTime::currentDateTime().toString()).toBase64() + "-end"; - mime += "MIME-Version: 1.0\n"; - mime += "Content-type: multipart/mixed; boundary=\"" + boundary + "\"\n\n"; + mime += "MIME-Version: 1.0\r\n"; + mime += "Content-type: multipart/mixed; boundary=\"" + boundary + "\"\r\n\r\n"; /* ====== END OF MIME HEADER ======== */ @@ -166,9 +166,9 @@ QString MimeMessage::toString() QList::iterator i; for (i = parts.begin(); i != parts.end(); ++i) - mime += boundary + "\n" + (*i)->toString(); + mime += boundary + "\r\n" + (*i)->toString(); - mime += boundary + "--\n"; + mime += boundary + "--\r\n"; /* ====== END OF MIME BODY ========= */ diff --git a/src/mimepart.cpp b/src/mimepart.cpp index 70aec14..d87064b 100644 --- a/src/mimepart.cpp +++ b/src/mimepart.cpp @@ -143,7 +143,7 @@ void MimePart::prepare() if (cCharset != "") mimeString.append("; charset=").append(cCharset); - mimeString.append("\n"); + mimeString.append("\r\n"); /* ------------ */ /* Content-Transfer-Encoding */ @@ -151,29 +151,29 @@ void MimePart::prepare() switch (cEncoding) { case _7Bit: - mimeString.append("7bit\n"); + mimeString.append("7bit\r\n"); break; case _8Bit: - mimeString.append("8bit\n"); + mimeString.append("8bit\r\n"); break; case Base64: - mimeString.append("base64\n"); + mimeString.append("base64\r\n"); break; case QuotedPrintable: - mimeString.append("quoted-printable\n"); + mimeString.append("quoted-printable\r\n"); break; } /* ------------------------ */ /* Content-Id */ if (cId != NULL) - mimeString.append("Content-ID: <").append(cId).append(">\n"); + mimeString.append("Content-ID: <").append(cId).append(">\r\n"); /* ---------- */ /* ------------------------- */ - mimeString.append(header).append("\n"); + mimeString.append(header).append("\r\n"); /* === End of Header Prepare === */ @@ -193,7 +193,7 @@ void MimePart::prepare() mimeString.append(QuotedPrintable::encode(content)); break; } - mimeString.append("\n"); + mimeString.append("\r\n"); /* === End of Content Encoding === */ prepared = true; diff --git a/src/smtpclient.cpp b/src/smtpclient.cpp index fca3ea8..30c435a 100644 --- a/src/smtpclient.cpp +++ b/src/smtpclient.cpp @@ -272,7 +272,7 @@ bool SmtpClient::sendMail(MimeMessage& email) sendMessage(email.toString()); - // Send \n.\n to end the mail data + // Send \r\n.\r\n to end the mail data sendMessage("."); waitForResponse();