Jump to content
alf.krause

ICS SmtpClient Mime Header Encode

Recommended Posts

How can I MIME encode the subject and sender (RFC2047)? Some providers now require this, for example, web.de.

https://postmaster.web.de/en/case?c=r0710

This case:
In case you use Non-ASCII characters like accented letters or symbols, please consider RFC 2047. For these characters you must use MIME encoding.
As soon as the corrections have been made by you, you can deliver emails to our system again.



 
Edited by alf.krause

Share this post


Link to post

Email headers are inline MIME encoded, using HdrEncodeInLine in the OverbyteIcsMimeUtils unit, there are a lot of options for character sets, Q or B encoding, and how to wrap or fold long lines.  

 

Look at the OverbyteIcsMimeDemo sample, this illustrates how to use HdrEncodeInLine and other similar MIME encoding and decoding functions. 

 

Angus

 

Share this post


Link to post

Thank's, it works for the subject but not for the HdrFrom (RFC2047) Non ASCII Characters - take a look to the link

Edited by alf.krause

Share this post


Link to post

So you are saying that:

 

Smtp.FromName :=  HdrEncodeInLineEx((MyStr, SpecialsRFC822, 'Q', CP_UTF8, 72, false); 

 

does not encode the name?  

 

It does seem the email samples don't actually use inline encoding, and perhaps it should be handled by the SMPT component, since we all use unicode compilers nowadays and expect strings to be converted properly.  If I can make that work in a backward compatible way, I'll look at adding it to ICS.  

 

Angus

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×