Load a new message of type msg

Dim message As MailMessage = New MailMessage()



message = MailMessage.Load(“c:\test\test.msg”, MessageFormat.Msg);





And the error message is



BC30311: Value of type ‘Aspose.Email.Mail.MessageFormat’ cannot be converted to ‘Aspose.Email.Mail.MailMessageLoadOptions’.



I am using the latest version 5.3.0.0

Hi Tuong,


Thank you for posting your query.

Please use the proper constructor of MailMessage with MailMessageLoadOptions. If the issue still persists, please share the sample message file with us for our reference.

Code:

message = MailMessage.Load(file name, MailMessageLoadOptions.DefaultMsg);

Hi Muhammad



It works



But is there a different between



message = MailMessage.Load(“filename.msg”, MailMessageLoadOptions.DefaultMsg)



And



message = MailMessage.Load(“filename.msg”)

Hi Tuong,

Thank you for sharing your feedback.

MailMessage by default assumes the file to be of EML type. Thus, if you will load a MSG file using this class, it will rise error. For loading MSG file, you need to specify the correct file type to be loaded using the MailMessageLoadOptions. Please feel free to write to us if you have further query about this functionality.