In .net I am having problems with the From and Reply-to field when their values contain both commas and utf-8 chars. Let me explain better:
I use this:
Dim Mail As New MailMessage
.....
Mail.From = New MailAddress(MailAddressFrom, mailFromName, System.Text.Encoding.UTF8)
I have tested with these three values of mailFromName
:
- "abc, abc"
- "æøå"
- "æøå, æøå"
Result when receiving the mail (note that example 3 fails horribly):
- From: "abc, abc"
- From: "æøå"
- From: =?utf-8?Q?=C3=A6=C3=B8=C3=A5,_=C3=A6=C3=B8=C3=A5?=
So where do I go wrong, should comma be escaped and how?