public void Remail()
{
string f="";
int n=int.Parse(TextBox1.Text.Trim());
jmail.Message Msg=new jmail.Message();
jmail.POP3 jpop=new jmail.POP3();
try
{
jpop.Connect("ssq","8223398","www.hbenshi.gov.cn",110);
Count.Text=jpop.Count.ToString();
Msg = jpop.Messages[n];
Sendform.Text = Msg.FromName;
Subject.Text = Msg.Subject;
Datetime.Text = Msg.Date.ToString();
Body.Text = Msg.Body;
num.Text=Msg.Attachments.Count.ToString();
for(int i=0;i<Msg.Attachments.Count;i++)
{
f=f+Msg.Attachments[i].Name;//.SaveToFile("c:\\"+Msg.Attachments[n].Name);
}
name.Text=f;
jpop.Disconnect();
}
catch(Exception ex)
{
Count.Text=ex.Message.ToString();
} }
{
string f="";
int n=int.Parse(TextBox1.Text.Trim());
jmail.Message Msg=new jmail.Message();
jmail.POP3 jpop=new jmail.POP3();
try
{
jpop.Connect("ssq","8223398","www.hbenshi.gov.cn",110);
Count.Text=jpop.Count.ToString();
Msg = jpop.Messages[n];
Sendform.Text = Msg.FromName;
Subject.Text = Msg.Subject;
Datetime.Text = Msg.Date.ToString();
Body.Text = Msg.Body;
num.Text=Msg.Attachments.Count.ToString();
for(int i=0;i<Msg.Attachments.Count;i++)
{
f=f+Msg.Attachments[i].Name;//.SaveToFile("c:\\"+Msg.Attachments[n].Name);
}
name.Text=f;
jpop.Disconnect();
}
catch(Exception ex)
{
Count.Text=ex.Message.ToString();
} }
现在有些邮件服务器不支持读取新邮件的操作,如果只是要读取新邮件的话,通用性不好
你可以参见http://www.duplo.se/
选择jmail的manuals,你可以下载关于jmail的中文帮助。