New line characters changed from \n to \r\n.
This commit is contained in:
parent
d4020ab70a
commit
871a1f5daa
@ -35,7 +35,7 @@ MimeAttachment::~MimeAttachment()
|
|||||||
|
|
||||||
void MimeAttachment::prepare()
|
void MimeAttachment::prepare()
|
||||||
{
|
{
|
||||||
this->header += "Content-disposition: attachment\n";
|
this->header += "Content-disposition: attachment\r\n";
|
||||||
|
|
||||||
/* !!! IMPORTANT !!! */
|
/* !!! IMPORTANT !!! */
|
||||||
MimeFile::prepare();
|
MimeFile::prepare();
|
||||||
|
@ -38,7 +38,7 @@ MimeInlineFile::~MimeInlineFile()
|
|||||||
|
|
||||||
void MimeInlineFile::prepare()
|
void MimeInlineFile::prepare()
|
||||||
{
|
{
|
||||||
this->header += "Content-Disposition: inline\n";
|
this->header += "Content-Disposition: inline\r\n";
|
||||||
|
|
||||||
/* !!! IMPORTANT !!! */
|
/* !!! IMPORTANT !!! */
|
||||||
MimeFile::prepare();
|
MimeFile::prepare();
|
||||||
|
@ -107,7 +107,7 @@ QString MimeMessage::toString()
|
|||||||
mime += " " + sender->getName();
|
mime += " " + sender->getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mime += " <" + sender->getAddress() + ">\n";
|
mime += " <" + sender->getAddress() + ">\r\n";
|
||||||
/* ---------------------------------- */
|
/* ---------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ QString MimeMessage::toString()
|
|||||||
mime += " " + (*it)->getName();
|
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";
|
QString boundary = "----MIME-part-boundary=" + QByteArray().append(QDateTime::currentDateTime().toString()).toBase64() + "-end";
|
||||||
|
|
||||||
mime += "MIME-Version: 1.0\n";
|
mime += "MIME-Version: 1.0\r\n";
|
||||||
mime += "Content-type: multipart/mixed; boundary=\"" + boundary + "\"\n\n";
|
mime += "Content-type: multipart/mixed; boundary=\"" + boundary + "\"\r\n\r\n";
|
||||||
|
|
||||||
/* ====== END OF MIME HEADER ======== */
|
/* ====== END OF MIME HEADER ======== */
|
||||||
|
|
||||||
@ -166,9 +166,9 @@ QString MimeMessage::toString()
|
|||||||
|
|
||||||
QList<MimePart*>::iterator i;
|
QList<MimePart*>::iterator i;
|
||||||
for (i = parts.begin(); i != parts.end(); ++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 ========= */
|
/* ====== END OF MIME BODY ========= */
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ void MimePart::prepare()
|
|||||||
if (cCharset != "")
|
if (cCharset != "")
|
||||||
mimeString.append("; charset=").append(cCharset);
|
mimeString.append("; charset=").append(cCharset);
|
||||||
|
|
||||||
mimeString.append("\n");
|
mimeString.append("\r\n");
|
||||||
/* ------------ */
|
/* ------------ */
|
||||||
|
|
||||||
/* Content-Transfer-Encoding */
|
/* Content-Transfer-Encoding */
|
||||||
@ -151,29 +151,29 @@ void MimePart::prepare()
|
|||||||
switch (cEncoding)
|
switch (cEncoding)
|
||||||
{
|
{
|
||||||
case _7Bit:
|
case _7Bit:
|
||||||
mimeString.append("7bit\n");
|
mimeString.append("7bit\r\n");
|
||||||
break;
|
break;
|
||||||
case _8Bit:
|
case _8Bit:
|
||||||
mimeString.append("8bit\n");
|
mimeString.append("8bit\r\n");
|
||||||
break;
|
break;
|
||||||
case Base64:
|
case Base64:
|
||||||
mimeString.append("base64\n");
|
mimeString.append("base64\r\n");
|
||||||
break;
|
break;
|
||||||
case QuotedPrintable:
|
case QuotedPrintable:
|
||||||
mimeString.append("quoted-printable\n");
|
mimeString.append("quoted-printable\r\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* ------------------------ */
|
/* ------------------------ */
|
||||||
|
|
||||||
/* Content-Id */
|
/* Content-Id */
|
||||||
if (cId != NULL)
|
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 === */
|
/* === End of Header Prepare === */
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ void MimePart::prepare()
|
|||||||
mimeString.append(QuotedPrintable::encode(content));
|
mimeString.append(QuotedPrintable::encode(content));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mimeString.append("\n");
|
mimeString.append("\r\n");
|
||||||
/* === End of Content Encoding === */
|
/* === End of Content Encoding === */
|
||||||
|
|
||||||
prepared = true;
|
prepared = true;
|
||||||
|
@ -272,7 +272,7 @@ bool SmtpClient::sendMail(MimeMessage& email)
|
|||||||
|
|
||||||
sendMessage(email.toString());
|
sendMessage(email.toString());
|
||||||
|
|
||||||
// Send \n.\n to end the mail data
|
// Send \r\n.\r\n to end the mail data
|
||||||
sendMessage(".");
|
sendMessage(".");
|
||||||
|
|
||||||
waitForResponse();
|
waitForResponse();
|
||||||
|
Loading…
Reference in New Issue
Block a user