- Warning 2 'Public Shared Function Load(fileName As String, options As Aspose.Email.Mail.MailMessageLoadOptions) As Aspose.Email.Mail.MailMessage' is obsolete: 'Use method Load(string fileName, LoadOptions options) instead this.'
- Warning 3 'Aspose.Email.Mail.MailMessageLoadOptions' is obsolete: 'Use LoadOptions with suitable MessageFormat instead this.'
- Warning 4 'Public Shared ReadOnly Property DefaultEml As Aspose.Email.Mail.MailMessageLoadOptions' is obsolete: 'Use EmlLoadOptions instead this.'
Hi David,
These methods have been marked as deprecated and will be removed in subsequent versions of the API. The new loading methods are as you found and suggested below . Please let us know if you need further help about this.
Code:
// Load from eml
MailMessage eml = MailMessage.Load(“test.eml”, new EmlLoadOptions());
// Load from html
MailMessage eml = MailMessage.Load(“test.html”, new HtmlLoadOptions());
// load from mhtml
MailMessage eml = MailMessage.Load(“test.mhtml”, new MhtmlLoadOptions());
// load from msg
MailMessage eml = MailMessage.Load(“test.msg”, new MsgLoadOptions());
// load from thef fomat
MailMessage eml = MailMessage.Load(“winmail.dat”, new TnefLoadOptions());
// loading with custom options
EmlLoadOptions opt = new EmlLoadOptions
{
PrefferedTextEncoding = Encoding.UTF8,
PreserveTnefAttachments = true
};
MailMessage eml = MailMessage.Load(“test.html”, opt);
HtmlLoadOptions opt = new HtmlLoadOptions
{
PrefferedTextEncoding = Encoding.UTF8,
ShouldAddPlainTextView = true,
PathToResources = @“D:\images”
};
MailMessage eml = MailMessage.Load(“test.html”, opt);