Manipulate EML

Hello,

is it possible with Aspose.Email to load an .EML file, chnage its Subject and save it back on filesystem ?
Thanks,

Fabio D’Antonio

Hi Fabio,

Thank you for posting your query.

Yes, you can load an existing EML file, manipulate it for any changes and save it to any format as per your requirements. The supported formats are:

  • EML
  • MSG
  • MSG Unicode
  • HTML
  • MHTML

Please try the code sample at your end and let us know your feedback if you need further assistance for this requirement.

Code:

MailMessage eml = MailMessage.Load(“input.eml”, MailMessageLoadOptions.DefaultEml);
eml.Subject = "New Subject";
eml.Save("output.eml", Aspose.Email.Mail.SaveOptions.DefaultEml); //save as EML
eml.Save("output.msg", Aspose.Email.Mail.SaveOptions.DefaultMsgUnicode); //save as MSG
eml.Save("output.mhtml", Aspose.Email.Mail.SaveOptions.DefaultMhtml); //save as MHTML