各位大侠,现在我做个留言板,想把保存的留言信息直接发送到指定的邮箱里,请问怎么实现?

解决方案 »

  1.   

    private void Send1(string title,string body,string Email)
    {
    MailMessage mal = new MailMessage();
    SmtpMail.SmtpServer="SMTP.163.com";
    mal.From="发送邮箱";
    mal.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
    //认证的用户名
    mal.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "邮箱用户名");
    //认证密码
    mal.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword","密码");
    mal.To = Email;
    mal.Subject=title;
    mal.Body=body;
    SmtpMail.Send(mal);
    }