zoukankan      html  css  js  c++  java
  • VS.NET发送普通邮件原码

    public static void SendMail(string toEmail,string bodyEmail,string subjectEmail)
            {
                try
                {
                    MailMessage mm = new MailMessage();
                        mm.From = new MailAddress("MESSYSTEM@AMATECH.CN","MES系統");
                    //MailAddress mafrom = new MailAddress("MESSYSTEM@AMATECH.CN", "MES系統");
                    //mm.From = mafrom;
                    mm.To.Add(toEmail);
                    mm.Body = bodyEmail;
                    mm.Subject = subjectEmail;
                    mm.Priority = MailPriority.High;
                    SmtpClient sc = new SmtpClient();
                    sc.Host = "172.22.236.5";
                    string userid = "";
                    string pswd = "";
                    string domain = "";
                    userid = "pega\roy_gu";
                    pswd = "@xiaoli123"
                    domain = "mail.sz.honyun.cn"

                    sc.Credentials = new System.Net.NetworkCredential(userid, pswd, domain);
                    sc.DeliveryMethod = SmtpDeliveryMethod.Network;
                    sc.Send(mm);
                }
                catch
                {
                    MessageBox.Show("郵件未能成功能發送,\r\n請與管理員聯繫!", "MES系統", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }

  • 相关阅读:
    灵活的JavaScript(一)
    菜鸟快飞之JavaScript对象、原型、继承(三)
    菜鸟快飞之JavaScript对象、原型、继承(二)
    菜鸟快飞之JavaScript对象、原型、继承(一)
    undo清理 &redo 持久化
    mysql执行计划分析
    mysql5.6的统计信息
    pt-online-schema-change原理分析
    校验主从数据并修复
    使用伪master+binlog恢复数据
  • 原文地址:https://www.cnblogs.com/vic_lu/p/1810025.html
Copyright © 2011-2022 走看看