NSF to MSG Conversion


#1

Hello,
We are craeting MSG Files from NSF database, So at the time of creating MSG every part of the email is working fine except the date. and also the MSG which is created is opening in editable mode.

// Create an instance of the Aspose.Email.MailMessage class
MailMessage msg = new MailMessage();
// Set recipients information
msg.To = doc.GetItemValue(“sendto”)[0];
msg.From = doc.GetItemValue(“from”)[0];
msg.Date = doc.GetItemValue(“PostedDate”)[0];

// Set the subject

msg.Subject = doc.GetItemValue(“subject”)[0];

// Set HTML body
msg.HtmlBody = nMime.ContentAsText.ToString();

msg.Save(global_var.msg_eml_path + sba.ToString() + @"" + i + “.msg”, SaveOptions.DefaultMsgUnicode);

Thanks & regards
Mantu Malakar


#2

Hi Mantu,


Thank you for posting your inquiry.

In order to save the message in Sent form, please set the MailMessage.IsDraft property to false. This will also allow you to set date on the message. Please try it at your end and let us know your feedback.

#3

Thank You.
this is working fine.

Thanks & Regards
Mantu Malakar


#4

Hi Mantu,


You are welcome and please feel free to write to us if you have any further query related to API functionality.