Hi,
I use UTF-8 encoded templates to design messages for sending using gnozals PureSMTP. The used subject is encoded in this template, too. I set
Content-Type: text/html; charset=utf-8;
and the complete body is ok. Using Outlook and Thunderbird, the UTF-8 encoded subject is correct, too. But some e-mail programs (tobit david for example) fail to display the UTF-8 encoded subject of the e-mail.
How do I need to convert the subject for all kind of e-mail clients? Is there a quoted printable encoding algorithm available for PureBasic?
Kukulkan
UTF-8 in e-mail subject - quoted printable?
My understanding is that the subject of an email must be in 7bit ascii to be standard. For subjects that contain other codings (like UTF8 etc) they have a type marker and then the bytes encoded in base64.
like this
Subject: =?utf-8?B?UkEU6IEVNUyAtIFRFU1Q5IOCuOOCueOBmOOFg+OBquOBj+OBpg==?=
=?utf-8?B?
like this
Subject: =?utf-8?B?UkEU6IEVNUyAtIFRFU1Q5IOCuOOCueOBmOOFg+OBquOBj+OBpg==?=
=?utf-8?B?
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Hi pdwyer,
Thank you. Your information completed the puzzle.
I found the following way to manage the problem using PB:
Seems to work without any problems...
Kukulkan
Thank you. Your information completed the puzzle.
I found the following way to manage the problem using PB:
Code: Select all
Subject.s = "UTF-8 encoded string like Versandbestätigung"
SubjectBase64.s = Space(Len(Subject.s) * 2)
Base64Encoder(@Subject.s, Len(Subject.s), @SubjectBase64.s, Len(SubjectBase64.s))
Subject.s = "=?UTF-8?B?" + SubjectBase64.s + "?="
Kukulkan
Cheers, I was wondering if that would work... 
Now I don't need to spend the time! Thanks
Now I don't need to spend the time! Thanks
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
-
Seymour Clufley
- Addict

- Posts: 1267
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Now I need such a function!Is there a quoted printable encoding algorithm available for PureBasic?
I found this VB function but it involves using something called "CDO.Message object".
Can anyone help out?
Hi,
Quoted Printable seem to be less complicated than UTF-8. The result may be such a string:
Original: Hätten Hüte ein ß im Namen, wären sie möglicherweise keine Hüte mehr, sondern Hüße.
QP: H=E4tten H=FCte ein =DF im Namen, w=E4ren sie m=F6glicherweise keine H=FCte= mehr, sondern H=FC=DFe.
Every byte that is not between 33–60 and 62–126 will be replaced by = followed by the uppercase hex value.
Here is more information:
http://en.wikipedia.org/wiki/Quoted-printable
Will be only a work of some minutes.
Kukulkan
Quoted Printable seem to be less complicated than UTF-8. The result may be such a string:
Original: Hätten Hüte ein ß im Namen, wären sie möglicherweise keine Hüte mehr, sondern Hüße.
QP: H=E4tten H=FCte ein =DF im Namen, w=E4ren sie m=F6glicherweise keine H=FCte= mehr, sondern H=FC=DFe.
Every byte that is not between 33–60 and 62–126 will be replaced by = followed by the uppercase hex value.
Here is more information:
http://en.wikipedia.org/wiki/Quoted-printable
Will be only a work of some minutes.
Kukulkan
