C#發送郵件

//TODO:發送郵件
  private void Btn_Send_Click(object sender, System.EventArgs e)
  {
  msgTo.From = "[email protected]";
   msgTo.BodyFormat = MailFormat.Text ;
   msgTo.Body = mailtxt;
   msgTo.Subject = title;
   msgTo.Priority = MailPriority.Normal;
   msgTo.To = "[email protected];[email protected]";
   msgTo.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
   msgTo.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "amthlon");
   msgTo.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "pwd");
   SmtpMail.SmtpServer = "smtp.tom.com";
  SmtpMail.Send(msgTo);
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章