0 votes

Can I convert msg file to imap server, in selected folder?

by

1 Answer

0 votes

You can use MsgConverter to convert msg files into IMmail (MIME representation)

using (MsgConverter converter = new MsgConverter(file))
{
    if (converter.IsMessage)
    {
        IMail email = converter.CreateMessage();

    }
}

To upload emails using IMAP use UploadMessage method:

using (Imap imap = new Imap())
{
    imap.ConnectSSL("imap.example.com");
    imap.UseBestLogin("user", "password");

    imap.UploadMessage("INBOX", email);

    imap.Close();
}

You can find more details here:
https://www.limilabs.com/blog/uploading-emails-using-imap

by (296k points)
...