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