zoukankan      html  css  js  c++  java
  • C#实现监听网易邮箱

    要用到 S22.Imap 一个开源的动态库

    string host = "网易收件服务器";
    int port = 993;//用的qq邮箱发的端口是993 网易的是995 监听网易邮箱要监听993端口
    string username = "账号";
    string password = "密码";

    using (ImapClient client = new ImapClient(host, port, username, password, AuthMethod.Login, true))
    {

    IEnumerable<uint> uids = client.Search(SearchCondition.Unseen());
    // Download mail messages from the default mailbox.
    IEnumerable<MailMessage> messages = client.GetMessages(uids, FetchOptions.HtmlOnly);
    foreach (var item in messages)
    {
    string From = item.From.ToString();
    string Body = item.Body.ToString();
    string Subject = item.Subject.ToString();
    }


    }

    就是这么简单

    Github地址:https://github.com/yuzd/S22.Imap

  • 相关阅读:
    sql_LIKE
    sql_TOP
    oracle_存储过程
    注释@
    request.getAttribute()和request.getParameter()区别
    遍历map
    ORACLE
    JSP
    生成导入模板_设置列宽及标题_解析xml
    解析Excel_Poi
  • 原文地址:https://www.cnblogs.com/soundcode/p/15100528.html
Copyright © 2011-2022 走看看