Winforms发送邮件
// 首先开启smtp服务 try { MailMessage message = new MailMessage(); SmtpClient smtp = new SmtpClient(); message.From = new MailAddress("from@domain.com"); message.To.Add(new MailAddress("to@domain.com")); message.Subject = "Subject"; message.Body = "Hello World"; smtp.Port = 587; smtp.Host = "smtp.domain.com"; smtp.EnableSsl = true; smtp.UseDefaultCredentials = false; smtp.Credentials = new NetworkCredential("from@domain.com", "password"); smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.Send(message); } catch (Exception ex) { Console.WriteLine(ex.Message); }
把圈子变小,把语言变干净,把成绩往上提,把故事往心里收,现在想要的以后你都会有。