Change encoding of email headers to UTF-8

0 votes
asked Feb 6, 2014 by Tomas Knopp (58,890 points)
edited Feb 6, 2014

I have a question about generated email header. How can I change the Subject / To header fields encoding to UTF-8.

This header field was generated:

Subject: =?iso-8859-3?Q?=5BKEP_=A9letisi=5D_deneme_maili_-_read_receipt?=

But I need the header field encoded as:

Subject: =?UTF-8?Q?[KEP_=C4=B0letisi]_serdar_deneme_maili?=

Applies to: Rebex Secure Mail

1 Answer

0 votes
answered Feb 6, 2014 by Rebex KB (8,210 points)
edited Feb 6, 2014
 
Best answer

The encoding can be specified via the DefaultCharset property like this:

var mail = new MailMessage();
mail.DefaultCharset = Encoding.UTF8;
...