Hi, I am trying out the Mail.dll for our project which periodically (say, every 1 minute) checks the inbox, handles any emails found, then wait for the next timer tick.
So, my question is what the best practice is to use this Imap object: should I use a single memberwise object to keep one connection and do all the mail-related work or like your sample codes that always dispose it after each use.
using(Imap imap = new Imap())
{
imap.Connect("imap.server.com"); // or ConnectSSL for SSL
imap.UseBestLogin("user", "password");
imap.SelectInbox();
imap.Close();
}
Thanks.