-1

I am working on Forgot Password Functionality in Asp.Net MVC.

I am able to successfully send forgot password link to email thorugh SendEmailAsync Method, but email is isHtml = false.

How can I make it to true?

public Task SendAsync(IdentityMessage message)
{
   SmtpClient client = new SmtpClient();
   return client.SendMailAsync("email",
                                    message.Destination,
                                    message.Subject,
                                    message.Body);
}
M Armaan
  • 39
  • 8

1 Answers1

1

You need to use another overload which takes a MailMessage object. For example:

SmtpClient client = new SmtpClient();
var message = new MailMessage();
message.IsBodyHtml = true;
message.Body = "email";
//Set other properties such as subject etc.
return client.SendMailAsync(message);
DavidG
  • 113,891
  • 12
  • 217
  • 223