• 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);
                }
            }

  • 相关阅读:
    Java5 多线程实践
    ExtJS2.0实用简明教程 Border区域布局
    MySQL安装图解
    ExtJS2.0实用简明教程 组件的使用
    ExtJS2.0实用简明教程 ExtJS版的Hello
    Linux操作系统中如何安装Tomcat
    线程池的介绍及简单实现
    ExtJS2.0实用简明教程 获得ExtJS
    汽车常识全面介绍 动力系统
    MySQL 图形化管理工具介绍
  • 原文地址:https://www.cnblogs.com/vic_lu/p/1810025.html
Copyright © 2020-2023  润新知