0 votes
by (150 points)

Hello,

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:

"a,b"@mymail.com

How can I prevent the ContentId from being modified?

Thanks in advance and regards,
Greg

Applies to: Rebex Secure Mail

1 Answer

0 votes
by (72.7k 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" + '"';
...