-1

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:

  1. "abc, abc"
  2. "æøå"
  3. "æøå, æøå"

Result when receiving the mail (note that example 3 fails horribly):

  1. From: "abc, abc"
  2. From: "æøå"
  3. 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?

dda
  • 6,030
  • 2
  • 25
  • 34
Muleskinner
  • 14,150
  • 19
  • 58
  • 79

1 Answers1

0

Nope, your FROM is encoded perfectly. The comma is not a special character, and you encoded the space properly. Unless there's another problem we can't see, it's your email app. Have you tried sending to other email accounts, web based ones maybe, like GMail or Yahoo or Hotmail?

dda
  • 6,030
  • 2
  • 25
  • 34