We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Exception when setting mail recipients with unicode character


I get an exception when doing the following:

Aspose.Email.Mail.MailMessage mail = new Aspose.Email.Mail.MailMessage();


Any possible workarounds?


Thank you for using Aspose products.

Please share the exception message and the version of Aspose.Email for .NET that you are using. As an alternative, please try as below with latest version of Aspose.Email for .NET v1.1.0


MailMessage message = new MailMessage();

message.To = new MailAddress("abc@domain.com");


I tried with the latest version to no avail.

I’m getting the following exception:

An invalid character was found in the mail header.

An invalid character was found in the mail header.

IDictionary (0 items)
InnerException null
StackTrace at ‰.Ÿ.‡(String , Int32& , StringBuilder )
at ‰.Ÿ.†(String , Int32& , StringBuilder )
at ‰.Ÿ.Ž(String data, Int32& offset, String& displayName, Boolean checkAddress)
at ‰.Ÿ.Ž(String , Int32& , Boolean )
at Aspose.Email.Mail.MailAddressCollection.˜(String , Boolean )
at Aspose.Email.Mail.MailAddressCollection.op_Implicit(String addresses)
HelpLink null



I am afraid, it seems that the problem is with your message. Please provide us your sample message file for our review.

Thank you.


I’m not loading any message file. My entire sample code is the one I included in my original post:

Aspose.Email.Mail.MailMessage mail = new Aspose.Email.Mail.MailMessage();


The error seems to be due to the fact the e-mail address contains an unicode character: æ.


Thank you for the clarification.

I am able to replicate the problem with unicode character in email address. For investigative purposes I have logged a ticket in our tracking system. The ticket Id for your reference is 32477.

We will keep you posted with updates.

The issues you have found earlier (filed as 32477) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.