using System.Net.Mail; MailMessage mail; SmtpClient client; try { mail = new MailMessage(发送地址, 接收地址); mail.Subject =主题.Trim().ToString(); mail.Body = 内容.Text.Trim().ToString(); client = new SmtpClient("smtp.qq.com", 25);//qq smtp端口25,如果是163,则改成smtp.163.com client.Credentials = new System.Net.NetworkCredential(sentID.Text.ToString(),this.password.Text);//验证 client.Send(mail); MessageBox.Show("Success!!"); } catch (Exception exception) { MessageBox.Show(exception.Message); }
by: 发表于:2018-01-29 11:01:11 顶(0) | 踩(0) 回复
??
回复评论