Thank you!
If someone has the same problem, here is the code:
"Received: from support@microsoft.com\r\n"
"Date: " + date.toString() + "\r\n"
"From: Dude\r\n"
"To: Dude\r\n"
"Subject: Your PC is infected by our company\r\n"
"MIME-Version: 1.0\r\n"
"Content-Type: multipart/related; boundary=_markeraaaaa\r\n"
"\r\n"
"--_markeraaaaa\r\n"
"Content-Type: text/html; charset=UNICODE-1-1-UTF-7\r\n"
"\r\n"
"<h1>Hello, dude!!!ääääää</h1>\r\n"
"--_markeraaaaa\r\n"
"Content-Type: image/jpeg; name=pic.jpg\r\n"
"Content-Transfer-Encoding: base64\r\n"
"\r\n" +
str + "\r\n" +
"--_markeraaaaa--\r\n"
"\r\n.\r\n"
"Received: from support@microsoft.com\r\n"
"Date: " + date.toString() + "\r\n"
"From: Dude\r\n"
"To: Dude\r\n"
"Subject: Your PC is infected by our company\r\n"
"MIME-Version: 1.0\r\n"
"Content-Type: multipart/related; boundary=_markeraaaaa\r\n"
"\r\n"
"--_markeraaaaa\r\n"
"Content-Type: text/html; charset=UNICODE-1-1-UTF-7\r\n"
"\r\n"
"<h1>Hello, dude!!!ääääää</h1>\r\n"
"--_markeraaaaa\r\n"
"Content-Type: image/jpeg; name=pic.jpg\r\n"
"Content-Transfer-Encoding: base64\r\n"
"\r\n" +
str + "\r\n" +
"--_markeraaaaa--\r\n"
"\r\n.\r\n"
To copy to clipboard, switch view to plain text mode
By the message, which is written above we will send one line of text and the picture. str is that picture, which was base64-encoded. For instance, in this way:
QFile file("E:\\linux-penguin-computing.jpg");
QString str
= file.
readAll().
toBase64() + "\r\n";
file.close();
QFile file("E:\\linux-penguin-computing.jpg");
file.open(QIODevice::ReadOnly);
QString str = file.readAll().toBase64() + "\r\n";
file.close();
To copy to clipboard, switch view to plain text mode
Bookmarks