Free Support Forum - aspose.com

Load MailMessage from MIME string

Hello,


Is it possible to create a MailMessage from a string representation of an email in MIME format?

Thanks.

Hi,

Thank you for inquiry.

MailMessage.Load() accepts string, but it would consider it as file name. You may use below method to first convert the string into stream and then load it in MailMessage.

MailMessage msg = MailMessage.Load(new MemoryStream(Encoding.UTF8.GetBytes(msgString)), MessageFormat.Eml);

Thanks, that worked.