0 votes

I have an email with message-id containing whitespace.
I noticed that using

new MailBuilder().CreateFromEml(/*some eml string*/)

I get an email with message-id that doesn't contain whitespace. Is that correct? As a workaround I pulled message-id from headers. Do you think it's safe?

Thank you for help.

by

1 Answer

0 votes

Message-Id is not allowed to contain spaces. IMail.MessageId removes any spaces from this string.

You can obtain exact header value by using following code:

IMail email = ...;
string value = email.Headers["Message-Id"];

MailBuilder.CreateFromEml(string eml) method is obsolete, please use MailBuilder.CreateFromEml(byte[] eml)

by (301k points)
CreateFromEml(string) is obsolete
...