zoukankan      html  css  js  c++  java
  • c#发送邮件

                MailMessage mailMsg = new MailMessage();
                mailMsg.From = new MailAddress("发送人邮箱帐号", "发送人昵称");
                mailMsg.To.Add(new MailAddress("收件人地址", "收件人昵称"));
                mailMsg.Subject = txtTitle.Text;//标题
                mailMsg.Body = txtMail.Text;
                mailMsg.IsBodyHtml = true;//正文可以为html
                mailMsg.BodyEncoding = Encoding.GetEncoding("GB2312");
                SmtpClient client = new SmtpClient("smtp.live.com");//发送邮箱服务器
                client.EnableSsl = true;//要求安全连接的,hotmail需要,网易,QQ不用
                client.Credentials = new NetworkCredential("发送人的账号", "发送人的密码");
                client.Send(mailMsg);
  • 相关阅读:
    【LeetCode每天一题】Combinations(组合)
    【算法】字符串匹配算法
    【LeetCode每天一题】Edit Distance(编辑距离)
    【LeetCode每天一题】Set Matrix Zeroes(设置0矩阵)
    SpringIOC和DI
    SpringMVC基础
    SpringMVC框架简介
    Spring配置JDBCTemplate
    java自定义注解
    KTV项目之3个ListView的跳转和加载歌手图片
  • 原文地址:https://www.cnblogs.com/automation/p/3014977.html
Copyright © 2011-2022 走看看