0 votes
by (150 points)


I've noticed that when I create a new Attachment and try to set its ContentId property to a string that contains a comma "," and "@", the created value is getting escaped in an unexpected way:

attachment.ContentId = "a,b@mymail.com";

When I retrieve the value of it again, it's modified to:


How can I prevent the ContentId from being modified?

Thanks in advance and regards,

Applies to: Rebex Secure Mail

1 Answer

0 votes
by (69.2k points)
selected by
Best answer

The attachment.ContentId is parsed as mail address by default. Since comma ',' is standard separator for mail addresses the value "a,b@mymail.com" is quoted to "a,b"@mymail.com automatically.

To disable this conversion, you have to put whole value to quotes e.g. like this:

attachment.ContentId = '"' + "a,b@mymail.com" + '"';