如何接收并读取邮件中的内容 下面是一个pop3接收类的一个方法。http://www.codeproject.com/csharp/pop3client.asp 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 OpenPOP.NET(http://sourceforge.net/projects/hpop) 下面把所有邮件显示并显示附件并提供附件下载myJmail.POP3Class mypop3;mypop3.Connect("*****@***.**","*******","*******",110);mypop3.Logging=true;int stt,mailNum=1; myJmail.MessageClass Mail=new MessageClass();for(;mailNum<mypop3.Messages.Count;mailNum++){ Mail=(MessageClass)mypop3.Messages[mailNum]; Mail.ContentTransferEncoding="base64"; Mail.Encoding="base64"; Mail.Charset="GB2312"; Response.Write(Mail.Subject+"<br>"); Response.Write("<font color='red'>发信人:</font>"+Mail.FromName+"<br><font color='red'>发信地址:</font>"+Mail.From+"<br>"); Response.Write("<font color='red'>邮件内容:</font><br>"+Mail.Body+"<br><br><br>");Response.Write("<font color='red'>附件数:</font>"+Mail.Attachments.Count.ToString()+"<br>"); string AttName=""; for(int i=0;i<Mail.Attachments.Count;i++) { myJmail.Attachment att=Mail.Attachments[i]; AttName=att.Name; ((stt=AttName.IndexOf("\""))!=-1)AttName=AttName.Substring(0,stt); if(File.Exists(Server.MapPath(".//Attachment//")+AttName)){File.Delete(Server.MapPath(".//Attachment//")+AttName);} att.SaveToFile(Server.MapPath(".\\Attachment\\")+AttName); Response.Write("<a href='"+Server.MapPath(".//Attachment//")+AttName+"'>"+AttName+"</a><br>"); }} 如何在IIS中配置https, 关于焦点的获得 怎么在桌面程序生成文件 如何把做好的c#做成exe文件? 关于.NET程序中支持Automation的问题(高分) asp.net 如何取得页面刷新的次数 请问WPF有没有伸缩panel 请问?我用VS.NET开发的C#应用程序在我的机器上运行的不错,可是COPY到我朋友的机器上怎么运行不了? 关于Microsoft Agent Version 2.0的问题 如何复制一个目录及其目录下的所有子目录文件 如何接收邮件,和读里面的内容 ADO.NET中如何實現像Delphi中一樣強大的计算字段和查詢字段
mypop3.Connect("*****@***.**","*******","*******",110);
mypop3.Logging=true;
int stt,mailNum=1;
myJmail.MessageClass Mail=new MessageClass();
for(;mailNum<mypop3.Messages.Count;mailNum++)
{
Mail=(MessageClass)mypop3.Messages[mailNum];
Mail.ContentTransferEncoding="base64";
Mail.Encoding="base64";
Mail.Charset="GB2312";
Response.Write(Mail.Subject+"<br>");
Response.Write("<font color='red'>发信人:</font>"+Mail.FromName+"<br><font color='red'>发信地址:</font>"+Mail.From+"<br>");
Response.Write("<font color='red'>邮件内容:</font><br>"+Mail.Body+"<br><br><br>");
Response.Write("<font color='red'>附件数:</font>"+Mail.Attachments.Count.ToString()+"<br>");
string AttName="";
for(int i=0;i<Mail.Attachments.Count;i++)
{
myJmail.Attachment att=Mail.Attachments[i];
AttName=att.Name;
((stt=AttName.IndexOf("\""))!=-1)AttName=AttName.Substring(0,stt);
if(File.Exists(Server.MapPath(".//Attachment//")+AttName)){File.Delete(Server.MapPath(".//Attachment//")+AttName);}
att.SaveToFile(Server.MapPath(".\\Attachment\\")+AttName);
Response.Write("<a href='"+Server.MapPath(".//Attachment//")+AttName+"'>"+AttName+"</a><br>");
}
}