, , , , .
public static bool ForgotPassword(string fromAccount, string toAccount, string subject, string msg)
{
var ConfirmationMail = new MailMessage();
if (IsLiveMode)
{
ConfirmationMail = new MailMessage("abc@abc.com", toAccount, subject, msg);
}
else
{
ConfirmationMail = new MailMessage("abc@abc.com", toAccount, subject, msg);
}
ConfirmationMail.Priority = MailPriority.High;
ConfirmationMail.IsBodyHtml = true;
SmtpClient objSMTPClient = new SmtpClient();
try
{
objSMTPClient.Send(ConfirmationMail);
return true;
}
catch
{
return false;
}
}
<system.net>
<mailSettings>
<smtp from="no-reply@no-reply.com">
<network host="smtp.live.com" password="abcdefghijk" port="587" userName="atteeqKhawaja@msn.com" enableSsl="true" />
</smtp>
</mailSettings>
string code = manager.GeneratePasswordResetToken(user.Id);
string callbackUrl = IdentityHelper.GetResetPasswordRedirectUrl(code, Request);
bool emailSent = ForgotPassword(" khawaja Atteeq", Email.Text, "Reset Password", "Please reset your password by clicking <a href=\"" + callbackUrl + "\">here</a>.");