Reputation: 1856
I need to export an EML file from IMAP using Mailkit, however there are no methods to export the emails.
I didn't find any documentation either in MimeKit - Mailkit Documentation.
Is it possible to export EML files using Mailkit?
Upvotes: 5
Views: 7231
Reputation: 567
If you want to write MailMessage
to .eml
file using MimeKit, use this code
var mimeMessage = MimeMessage.CreateFromMailMessage(mail);
mimeMessage.WriteTo(new FileStream(@"path_to_file\new_mail.eml", FileMode.Create));
Upvotes: 5