如何使用IMAPX下载电子邮件 [英] How to download emails using IMAPX

查看:199
本文介绍了如何使用IMAPX下载电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用名为IMAPX的开源库与我的IMAP邮箱进行交互。我正在关注CodeProject上的这篇文章-https://www.codeproject.com/Articles/1083307/Building-custom-email-client -in-WPF-using-Csharp。我可以正确登录并检索电子邮件文件夹。但问题是,文章似乎不完整,这让我处于中间道路。首先是检索电子邮件文件夹。部分没有用。我不得不做一个解决方法。现在,我正在尝试下载文件夹的电子邮件。关于这个问题,文章只有几行代码:



  private   void  foldersList_SelectionChanged( object  sender,SelectionChangedEventArgs e)
{
var item = foldersList.SelectedItem as EmailFolder;

if (item!= null
{
// 为其邮件加载文件夹。
loadFolder(item.Title);
}
}

私有 void loadFolder( string name)
{
ContentFrame.Content = new FolderMessagesPage(name);
}





该文章没有解释有关`FolderMessagesPage`的任何内容。所以,我做了一个名为`FolderMessagesPage`的测试页面。我真的不知道该放哪个页面。可以请任何人指导我吗?



什么我试过了:



请指导我该怎么做?

解决方案

I已经尝试了几个Imap库,但没有一个可以正常使用Outlook 365,Gmail有时可以工作。

我到目前为止找到的最好的是 GitHub - jstedfast / MailKit:用于IMAP,POP3和SMTP的跨平台.NET库。 [ ^ ]

可在此处找到该教程:简介 [ ^ ]

I just started using the open-source library called IMAPX to interact with my IMAP mailbox.I am following this article on CodeProject -https://www.codeproject.com/Articles/1083307/Building-custom-email-client-in-WPF-using-Csharp .I can login properly and retrieve the email folders.But the problem is,the article seems to be incomplete which is leaving me in the middle of the road.Firstly the `Retrieving Email Folder`'s part didn't work.I had to do a workaround.Now , i am trying to download the emails of a folder.The article,regarding this issue,has only a few line of code :

  private void foldersList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
 var item = foldersList.SelectedItem as EmailFolder;

if(item != null)
{
    // Load the folder for its messages.
    loadFolder(item.Title);
}
}

private void loadFolder(string name)
{
 ContentFrame.Content = new FolderMessagesPage(name);
 }



The article doesn't explain anything about `FolderMessagesPage` . So , i made a test page named `FolderMessagesPage`.I literally have no idea what to put in that page.Can anybody please guide me ?

What I have tried:

Please guide me on what to do ?

解决方案

I have tried several Imap libraries, but none would work correctly with Outlook 365, Gmail sometimes works.
The best I found so far is GitHub - jstedfast/MailKit: A cross-platform .NET library for IMAP, POP3, and SMTP.[^]
The tutorial can be found here: Introduction[^]


这篇关于如何使用IMAPX下载电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆