Reputation: 159
I am trying to send a confirmation email and everything is working except that the link comes through as plain text and not as a clickable link.
This is my code:
public static Task SendEmailConfirmationAsync(this IEmailSender emailSender, string email, string link)
{
return emailSender.SendEmailAsync(email, "Please Confirm your email",
$"Please confirm your account by clicking this link: <a href='{link}'>link</a>");
}
Thank you in advance
Upvotes: 1
Views: 1722
Reputation: 11
you must sent us mail template. how are you writing on html page this code.
get link only like string and create a mail template and in a tag write like MailText = MailText.Replace("[FirstName]", user.FirstName).Replace("[email]", user.Email).Replace("[URL]", URL)
and in html you must write <a href="[URL]">Click Here</a>
Upvotes: 0
Reputation: 67
using NETCore.MailKit.Core;
Add true for html type: EmailService.Send(user.Email, "Reset Password", $"Please reset your password by clicking here: link",true)
Upvotes: 0
Reputation: 3777
Be sure to check that whatever email client you are using is displaying the email as HTML. It appears from your screenshot that the email is being displayed in plain text.
Upvotes: 2