0 votes

You have said that i should find eml version and send your support email.
And where could i find raw eml version?

by
edited by

1 Answer

0 votes

You download raw eml when you use GetMessageByUID method:

byte[] eml = imap.GetMessageByUID(uid);

You just need to save that byte[] array to file:

using (Imap imap = new Imap())
{
    imap.Connect("imap.example.com");    // use ConnectSSL for SSL
    imap.UseBestLogin("user", "password");

    imap.SelectInbox();

    List<long> uids = imap.Search(Expression.Subject("email subject"));

    foreach (long uid in uids)
    {
        var eml = imap.GetMessageByUID(uid);
        string fileName = string.Format(@"c:\email_{0}.eml", uid);

        File.WriteAllBytes(fileName, eml);
    }
    imap.Close();
}
by (297k points)
...