1〉不采取密码答案和问题
 2〉用邮件找回密码
 3〉用户自己输入注册邮件
 4〉发送到邮件中的是激活地址而非密码
 5〉注册时告诉用户这个密码将来要用来找回密码,提供测试邮件帐户能否收到系统的入口。
   6〉如果您将遗忘密码保护信息,可以填写申诉表来找回您的密码。

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

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

        message.Body 
= @"<a href='http://aa.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;
    }

}

source: http://www.cnblogs.com/cloudgamer/archive/2008/02/19/1072931.html


本文转载:CSDN博客