I am reading the mail body using streamReader with ASCII encoding type but the text received is in plain text format. It also contains some special characters like =92,=93,=94,=20 etc which does not resemble to html endoding. Also hyperlinks are converted to text like http://www.google.com http://www.google.com/
I debug the stream.getline function and find these lines containing content-Type, the first and second lines are before and after subject and third one is just before body of mail. Neither of three contains text/html.
Please advice what to do.
1. Content-Type: multipart/related; boundary=0015174479b83c0db404b1bf7ace
2. Content-Type: multipart/alternative; boundary=0015174479b83c0db104b1bf7acd
3. Content-Type: text/plain; charset=ISO-8859-1
Also please find the mail which I am reading:
Spammy title:
Spammy Body
Go to {spammy hyperlink}
The data in streamReader in get is:
Spammy title:** Spammy Body Go to spammydomain *
I don’t know why the * is attached at begining and end of every bold word/sentence and link is not treated as link.
also while debuging other mails I found that some characters are also replaced, here is the list I found.
"=85" replaces "..." on every occurance
"=93"replaces "\"" on every occurance
"=94"replaces "\"" on every occurance
"=92" replaces "'" on every occurance
"****\r\n" replaces "\n" randomly
"=\r\n" replaces "" randomly
"=20\r" replaces "" randomly
I tried Html Encoding / Decoding but nothing successfull.
Can you please suggest any encoding type or method to remove all the special characters and retain its html format.
Maybe you should start digging in some RFCs. I suggest:
RFC 822, "STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES", https://www.rfc-editor.org/rfc/rfc822
RFC 2047, "MIME (Multipurpose Internet Mail Extensions) Part Three Message Header Extensions for Non-ASCII Text", https://www.rfc-editor.org/rfc/rfc2047, and especially the 4.2. section about "The "Q" encoding" which I believe should details the "special characters" like =92, =93, etc…