I want to create a window application through which I can read email from gmail.
In fact, I want to read the correct email format, for example, from, topics, cups and bodies.
using (Imap imap = new Imap())
{
imap.ConnectSSL("mail.company.com");
imap.Login("angel_y@company.com", "xyx***");
imap.SelectInbox();
List<long> uids = imap.SearchFlag(Flag.Unseen);
foreach (long uid in uids)
{
string eml = imap.GetMessageByUID(uid);
IMail message = new MailBuilder()
.CreateFromEml(eml);
Console.WriteLine(message.Subject);
Console.WriteLine(message.TextDataString);
}
imap.Close(true);
}
This is mistake. No connection can be made because the target machine has actively abandoned it.
source
share