Reputation: 339
In my class we have been taught how to use the Net.Mail namespace to send mails, but never taught how to retrieve messages/inbox. After doing some research I found some resources to help with just that. Now I have the following code to start with :
using (var ic = new AE.Net.Mail.ImapClient("imap.gmail.com", "[email protected]", "pswrd", AE.Net.Mail.AuthMethods.Login, 993, true))
{
ic.SelectMailbox("INBOX");
MailMessage[] mm = ic.GetMessages(0, 10);
}
I download the AENETMAIL zip from here. What cs files and references should I include?
Upvotes: 1
Views: 2481
Reputation: 86
Use the NuGet AE.Net.Mail package. NuGet packages take care of everything and you don't have to worry about references, DLLs or missing files inside your solution or project.
Upvotes: 1
Reputation: 26
Open solution AE.Net.Mail.sln and build it. You'll receive .dll file. Add reference in your project to builded .dll. Paste using AE.Net.Mail.Imap; using AE.Net.Mail;
Upvotes: 1