public static jmail.POP3Class popMail; //实例化POP3类对象
public static jmail.Message mailMessage; //实例化邮件对象
public static jmail.Attachments atts; //实例化邮件的附件集合
public static jmail.Attachment att; //实例化附件对象
public static string strserver; //存储邮件服务器
public static string user; //存储用户登录邮箱的用户名
public static string pwd; //存储用户登录邮箱的密码
private void frmMain_Load(object sender, EventArgs e)
{
user = "。。。。。@139.com";
pwd = "。。。。。";
strserver = "pop.139.com";
popMail = new jmail.POP3Class();
if (popMail.Count != 0)
{
dgvEmailInfo.RowCount = popMail.Count;
if (popMail != null)
{
if (popMail.Count > 0)//当邮箱中存在邮件的情况下运行代码
{
for (int i = 1; i < popMail.Count; i++)
{
mailMessage = popMail.Messages[i];//**遇到大邮件时主要是这个过程耗时**间
//mailMessage.Charset = "GB2312";
if (mailMessage.From == user.Trim().ToLower())
{
dgvEmailInfo.Rows[i - 1].Cells[0].Value = "我";
}
else
{
dgvEmailInfo.Rows[i - 1].Cells[0].Value = mailMessage.From;
}
dgvEmailInfo.Rows[i - 1].Cells[1].Value = Base64Decode(mailMessage.Subject);
dgvEmailInfo.Rows[i - 1].Cells[2].Value = Base64Decode(mailMessage.Body);
dgvEmailInfo.Rows[i - 1].Cells[4].Value = mailMessage.Date.ToString();
if (popMail.Count >= 1 && i <= popMail.Count)
{
atts = mailMessage.Attachments;
if (atts.Count > 0)
{
dgvEmailInfo.Rows[i - 1].Cells[3].Value = "附件下载";
}
else
{
dgvEmailInfo.Rows[i - 1].Cells[3].Value = "无附件";
}
}
}
}
}
}
else
{
dgvEmailInfo.Rows.Clear();
}
Jmail4.4实现邮件接受,发现“邮件附件较大时(如40兆),接收邮件非常慢,求解决方法
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
悬赏问题
- ¥15 孟德尔随机化结果不一致
- ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
- ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
- ¥15 谁有desed数据集呀
- ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
- ¥15 关于#hadoop#的问题
- ¥15 (标签-Python|关键词-socket)
- ¥15 keil里为什么main.c定义的函数在it.c调用不了
- ¥50 切换TabTip键盘的输入法
- ¥15 可否在不同线程中调用封装数据库操作的类