MailMessage message = new MailMessage();
message.From = new MailAddress("hkar@gmail.com");
message.Subject = "Subject";
message.Body = "Please login";
SmtpClient smtp = new SmtpClient();
message.To.Add("karaman@gmail.com");
smtp.Send(message);
I want to have a hyperlink in the body of sent mail where it says "login". How can I do that?
Set the message to
message.IsBodyHTML = true
Make sure you highlight when sending that the content is HTML though.
You just have to set the format of body to html then you can add html element within the bosy of mail message
Format the message as HTML and make sure to set the IsBodyHtml property on the MailMessage to true:
message.IsBodyHtml = true;