MailMessage message = new MailMessage();
message.From = new MailAddress("[email protected]");
message.Subject = "Subject";
message.Body = "Please login";
SmtpClient smtp = new SmtpClient();
message.To.Add("[email protected]");
smtp.Send(message);
I want to have a hyperlink in the body of sent mail where it says "login". How can I do that?
message.Body = "Please <a href=\"http://www.example.com/login.aspx\">login</a>";
Make sure you highlight when sending that the content is HTML though.
message.IsBodyHTML = true;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With