MailHelper ,使用OpenPop读取邮件、获取附件、删除邮件等
using OpenPop.Mime;
using OpenPop.Mime.Header;
using OpenPop.Pop3;
using OpenPop.Pop3.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MyHelpers
{
public class MessageHeaderWrap
{
public MessageHeader Message;
public int MessageId;
}
public class MailHelper
{
#region 私有变量
private string account;
private string password;
private string popServer;
private int popPort;
private bool IsUseSSL;
#endregion
#region 构造函数
public MailHelper(string _account, string _password, string _popServer, int _popPort, bool _IsUseSSL)
{
account = _account;
password = _password;
popServer = _popServer;
popPort = _popPort;
IsUseSSL = _IsUseSSL;
}
#endregion
#region 方法
public bool ValidateAccount(ref string error)
{
Pop3Client client = new Pop3Client();
string message = "account:" + account + " password" + password + " popServer:" + popServer + " popPort:" + popPort