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;
1.4m articles
1.4m replys
5 comments
57.0k users