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);
  • 相关阅读:
    new delate he typedef的含义
    Importing the multiarray numpy extension module failed
    QT socket相关
    CMake的一些使用
    CMake undefined reference to `QTcpServer::QTcpServer(QObject*)'的解决
    MFC操作excel
    dsview
    phyton 相关学习
    面试相关
    远程连接
  • 原文地址:https://www.cnblogs.com/automation/p/3014977.html
Copyright © 2011-2022 走看看