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

    **//// <summary>
    /// 发送邮件
    /// </summary>

    public static bool SendEmailForGetpass(string name, string email, string random)
    {
        
    try
        
    {
            MailAddress from 
    = new MailAddress("xxx@163.com""ShundeBK.cn");
            MailAddress to 
    = new MailAddress(email, name);
            MailMessage message 
    = new MailMessage(from, to);
            message.Subject 
    = "顺德百科 ShundeBK.cn 取回密码";

            message.Body 
    = @"<a href='http://shundebk.cn/passport/Setpass.aspx?code=" + random + "' target='_blank'>取回密码</a>;
            message.Priority = MailPriority.High;
            message.IsBodyHtml 
    = true;

            SmtpClient client 
    = new SmtpClient("smtp.163.com");
            client.Credentials 
    = new System.Net.NetworkCredential("xxx""xxx");
            client.Send(message);

            
    return true;
        }

        
    catch (Exception e)
        
    {
            
    throw e;
            
    return false;
        }

    }

  • 相关阅读:
    [HNOI2004]L语言
    [TJOI2018]异或
    如何定位低效SQL?
    索引失效的情况有哪些?
    trace的作用?
    show profile的作用?
    索引的使用原则
    MySQL主从复制的步骤
    什么是聚簇索引
    什么是全文索引?
  • 原文地址:https://www.cnblogs.com/yibinboy/p/1304142.html
Copyright © 2011-2022 走看看