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;
Retrieve Gmail Inbox using AE NET Mail
题
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?
解决方案
其他提示
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.
- From Visual Studio, open the Solution Explorer (Ctrl+L)
- Right click on the project you want to add the library and select "Manage NuGet Packages"
- From the list on the left of the dialog select "Online", "All"
- Type "AE.Net.Mail" in the search bar located on the right upper side of the dialog
- When the package shows up in the Search Result list click "Install"
不隶属于 StackOverflow