public void Sendmail()
{

jmail.Message Msg=new jmail.Message();
Msg.Logging=true;
//日志启用
Msg.Logging=true;
Msg.Silent=true;
//smtpserver用户名,密码
Msg.MailServerUserName="gl77"; 
Msg.MailServerPassWord="8562";
//邮件主题
Msg.Subject="测试";
//邮件内容
Msg.Body="测试";
Msg.Encoding="base64";
Msg.Charset="gb2312"; 
//发信人
Msg.From="[email protected]";
Msg.FromName="gl77";
//添加收信人
Msg.AddRecipient( "[email protected]","gl77","ok");
//优先级
Msg.Priority=3;
//添加附件
Msg.AddAttachment("d:\\新建 文本文档.txt",true,"txt");
if(Msg.Send("smtp.163.com",false))
Count.Text="ok";

}

解决方案 »

  1.   

    public void Remail()
    {
    //n=第几封信
    jmail.Message Msg=new jmail.Message();
    jmail.POP3 jpop=new jmail.POP3();
    try
    {
    jpop.Connect("gl77","8562","pop3.163.com",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].SaveToFile("c:\\"+Msg.Attachments[n].Name);
    }
    name.Text=f;
    jpop.Disconnect();
    }
    catch(Exception ex)
    {
    Count.Text=ex.Message.ToString();
    } }
      

  2.   

    The message was undeliverable. All servers failed to receive the message
    还是失败了啊,你的JMAIL是什么版本?在哪下的给我地址可一么?
      

  3.   

    [email protected]
    还是发给我把,我想看看是不是一个版本