Hi wysota,
Thanks for your reply.
I have a confusion. What is the difference between first solution and your solution???
I tried your solution, the application says "MESSAGE SENT" but the mail is not received. I did this
Header
+= QString("Content-Type: multipart/related;") +
msgContent
+= QString("--=_marker\r\n");
msgContent
+= QString("Content-Type: text/html; charset=ISO-8859-2") + QString("\r\n");
msgContent
+= QString("Content-Disposition: attachment;") + QString( "filename=" ) + "fileName" + QString("\r\n");
attachmentContent
+= QString("--=_marker\r\n");
attachmentContent
+= QString("Content-Type: text/html; charset=ISO-8859-2") + QString("\r\n");
attachmentContent
+= QString("Content-Disposition: attachment;") + QString( "filename=" ) + "fileName" + QString("\r\n");
*t << "DATA\r\n"; //here t is QTextStream
*t << Header;
*t << msgContent;
*t << attachmentContent;
QString Header;
Header += QString("Content-Type: multipart/related;") +
QString("boundary=--_marker;") +
QString("type=text/html\r\n");
QString msgContent;
msgContent += QString("--=_marker\r\n");
msgContent += QString("Content-Type: text/html; charset=ISO-8859-2") + QString("\r\n");
msgContent += QString("Content-Disposition: attachment;") + QString( "filename=" ) + "fileName" + QString("\r\n");
msgContent += QString("Mime-version: 1.0") + QString("\r\n");
QString attachmentContent;
attachmentContent += QString("--=_marker\r\n");
attachmentContent += QString("Content-Type: text/html; charset=ISO-8859-2") + QString("\r\n");
attachmentContent += QString("Content-Disposition: attachment;") + QString( "filename=" ) + "fileName" + QString("\r\n");
attachmentContent += QString("Mime-version: 1.0") + QString("\r\n");
*t << "DATA\r\n"; //here t is QTextStream
*t << Header;
*t << msgContent;
*t << attachmentContent;
To copy to clipboard, switch view to plain text mode
These contents are sent to SMTP
HELO there
MAIL FROM: <xyz@gmail.com>
RCPT TO: <abc@yahoo.com>
DATA
Content-Type: multipart/related;boundary=--_marker;type=text/html
--=_marker
Content-Type: text/html; charset=ISO-8859-2
Content-Disposition: attachment;filename=fileName
Mime-version: 1.0
--=_marker
Content-Type: text/html; charset=ISO-8859-2
Content-Disposition: attachment;filename=fileName
Mime-version: 1.0
From: xyz@gmail.com
To: abc@yahoo.com
Subject: Hi..!!!
Hello How are u...???
QUIT
HELO there
MAIL FROM: <xyz@gmail.com>
RCPT TO: <abc@yahoo.com>
DATA
Content-Type: multipart/related;boundary=--_marker;type=text/html
--=_marker
Content-Type: text/html; charset=ISO-8859-2
Content-Disposition: attachment;filename=fileName
Mime-version: 1.0
--=_marker
Content-Type: text/html; charset=ISO-8859-2
Content-Disposition: attachment;filename=fileName
Mime-version: 1.0
From: xyz@gmail.com
To: abc@yahoo.com
Subject: Hi..!!!
Hello How are u...???
QUIT
To copy to clipboard, switch view to plain text mode
Any idea???
One more thing.. why is below code used in the smtp example
message.
replace( QString::fromLatin1( "\n" ),
message.
replace( QString::fromLatin1( "\r\n.\r\n" ),
QString::fromLatin1( "\r\n..\r\n" ) );
message.replace( QString::fromLatin1( "\n" ),
QString::fromLatin1( "\r\n" ) );
message.replace( QString::fromLatin1( "\r\n.\r\n" ),
QString::fromLatin1( "\r\n..\r\n" ) );
To copy to clipboard, switch view to plain text mode
If I remove this code the output is still same...
Thanks
Bookmarks