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", "someadress@gmail.com", "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?

enter image description here

有帮助吗?

解决方案

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;

其他提示

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.

  1. From Visual Studio, open the Solution Explorer (Ctrl+L)
  2. Right click on the project you want to add the library and select "Manage NuGet Packages"
  3. From the list on the left of the dialog select "Online", "All"
  4. Type "AE.Net.Mail" in the search bar located on the right upper side of the dialog
  5. When the package shows up in the Search Result list click "Install"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top