• C#邮箱发送验证码


     public static void SendTo(string mailAddress, string subject, string body)
            {

       //mailAddress 所要发送的邮箱地址,subject 邮件标题,body邮件内容

        //发送邮件所用邮箱(163邮箱)

        string Email_Send = Dsis.Core.SysCore.PubFunction.DataFilter(Dsis.Core.SysCore.SysFunction.GetParameterInfo("Email_Send")["PValue"]);

        //发送所用邮箱密码

                string Email_Password = Dsis.Core.SysCore.PubFunction.DataFilter(Dsis.Core.SysCore.SysFunction.GetParameterInfo("Email_Password")["PValue"]);
                MailMessage message = new MailMessage();

                message.From = new MailAddress(Email_Send, "发信人", System.Text.Encoding.UTF8);

        //被发送邮箱

                message.To.Add(new MailAddress(mailAddress));

       //邮件标题

                message.Subject = subject;

                message.IsBodyHtml = true;
                message.BodyEncoding = System.Text.Encoding.UTF8;

        //邮件内容
                message.Body = body;
                message.Priority = MailPriority.High;

                SmtpClient client = new SmtpClient("smtp.163.com");

       //所用邮箱和密码

                client.Credentials = new NetworkCredential(Email_Send, Email_Password);
                client.EnableSsl = true; //必须经过ssl加密 
                try
                {
                    client.Send(message);
                }
                catch (Exception ee)
                {
                    ShowMsg(ee.ToString());
                }
            }
            static void ShowMsg(string msg)

            { }

  • 相关阅读:
    javascript运行机制
    ios-scroll 和系统设置overflowscroll后卡顿
    input属性autocomplate背景颜色
    img 的onload事件和complate事件区别
    image图片之间缝隙bug解决方法
    gulp使用指南
    getQueryString
    decodeURI()和decodeURIComponent()函数
    css样式实现水平方向滚动
    I2C
  • 原文地址:https://www.cnblogs.com/duanlinlin/p/5026078.html
Copyright © 2020-2023  润新知