+1 vote

Good Day!

We use mail.dll to download the email metadata information (from, To, CC, Subject & Body) and attachments using POP3 in .NET. Please let us know if we have similar setup to download the email metadata information (from, To, CC, Subject & Body) and attachments using IMAP / SMTP in .NET.

Thanks in Advance!

by

1 Answer

0 votes
 
Best answer

Mail.dll supports both POP3 and IMAP for mail download and management:
https://www.limilabs.com/mail/samples#imap

using(Imap imap = new Imap())
{
    imap.Connect("imap.server.com");  // or ConnectSSL for SSL
    imap.UseBestLogin("user", "password");
    imap.SelectInbox();
    List<long> uids = imap.Search(Flag.Unseen);
    foreach (long uid in uids)
    {
        IMail email = new MailBuilder()
            .CreateFromEml(imap.GetMessageByUID(uid));
        string subject = email.Subject);
    }
    imap.Close();

}

SMTP email protocol is used to send emails only.
It is not possible to retrieve emails using SMTP protocol.

Please note that this is not a limitation of Mail.dll, but of the SMTP protocol itself.

by (297k points)
...