Hi,

The following error was logged in our system. It seems like the error happened when setting the subject property. I'm trying to find out what special characters would cause this error.

Source: Rebex.Mail Message: Invalid character at position 162. Parameter name: value

Stack Trace: at cSVAqj.CkMqVUZ.BIzNVcZ(String , String , Boolean ) at Rebex.Mime.Headers.Unstructured..ctor(String , Boolean ) at Rebex.Mail.MailMessage.set_Subject(String value)

I have tried to set these special characters in the subject and it seems to work:

@, #, $, %, ^, &, *, (, ), +, =, {, }, |, ', ~, `

Your help would be appreciated.

Thank you, Rajat

asked 20 Apr '11, 22:58

Rajat's gravatar image

Rajat
15
accept rate: 0%

edited 22 Apr '11, 02:24

Martin%20Vobr's gravatar image

Martin Vobr ♦♦
335310


This error is caused by special non-printable characters with ASCII code less than 32 (except the 'tab' character).

For example, the following code will throw the same exception:

C#:

var mail = new MailMessage();
mail.Subject = "Bad character: \x1";

VB.NET:

Dim mail as New MailMessage
mail.Subject = "Bad character: " & Chr(1)
link

answered 21 Apr '11, 14:18

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.4k28
accept rate: 31%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×53
×23
×9

Asked: 20 Apr '11, 22:58

Seen: 997 times

Last updated: 22 Apr '11, 02:24