DmitryNik
14th September 2011, 18:46
Hello!
I have read some threads on this forum related to smtp and attachments and I've read rfc's related to MIME, but still I have a problem. I believe it's only because of my misunderstanding.
I tried to send the message with html-body and the picture. But as a result I can send either message or picture.
Here is the code related to the mail body:
"MIME-Version: 1.0\r\n"
"Content-Type: multipart/mixed\r\n"
"Received: from support@support.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"
"Content-Type: text/html; charset=UNICODE-1-1-UTF-7\r\n"
"<h1>Hello, dude!!!ääääää</h1>"
"Content-Type: image/jpg; name=pic.jpg\r\n"
"Content-Transfer-Encoding: base64\r\n" +
str +
"\r\n.\r\n"
str is base64-encoded string.
I know about boundaries, but here is another problem: MIME didn't process them, and I saw in the message something like: --_________boundary-uniq-1;
What am I doing wrong? How it can be changed?
Thank you for answers beforehand.
I have read some threads on this forum related to smtp and attachments and I've read rfc's related to MIME, but still I have a problem. I believe it's only because of my misunderstanding.
I tried to send the message with html-body and the picture. But as a result I can send either message or picture.
Here is the code related to the mail body:
"MIME-Version: 1.0\r\n"
"Content-Type: multipart/mixed\r\n"
"Received: from support@support.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"
"Content-Type: text/html; charset=UNICODE-1-1-UTF-7\r\n"
"<h1>Hello, dude!!!ääääää</h1>"
"Content-Type: image/jpg; name=pic.jpg\r\n"
"Content-Transfer-Encoding: base64\r\n" +
str +
"\r\n.\r\n"
str is base64-encoded string.
I know about boundaries, but here is another problem: MIME didn't process them, and I saw in the message something like: --_________boundary-uniq-1;
What am I doing wrong? How it can be changed?
Thank you for answers beforehand.