hey you have to build HTML mail by setting the IsBodyHTML to true. Here you go:
public void sendmail(string v3, string v2, string v1) //replace the parameter or delete if needed
{
string smsg = "Thank you for posting Article on our site, your post is very important for us:<br><br>";
smsg += "<br><b>Title of Post: </b><br>" + "<a href=" + v1 + ">" + v2 + "</a>";
smsg += "<br><b>Description of Post: </b><br>" + v3;
smsg += "<br><br><br><br>";
smsg += "<b>Administrator</b>";
//in above lines I'm building HTML body for mailing, here you can use any standerd html tags
MailMessage message = new MailMessage();
try
{
string ToEmailIDToSendEmail = getEmailAddressOfUser(); //i'm just receiving TO email address from SQL Server DB by calling function
message.To.Add(new MailAddress(ToEmailIDToSendEmail)); //here you can directly use the TO mail
message.From = new MailAddress("use the same address i.e. ur username that will be used below");
message.Subject = "your email subject will be here";
message.Body = smsg;
message.IsBodyHtml = true; //always set this to true for html based mail
SmtpClient client = new SmtpClient();
client.Port = 587; // I uses port 587 for gmail, replace this if you needed
client.Host = "smtp.gmail.com"; //replace the host, i will be using gmail
System.Net.NetworkCredential nc = new System.Net.NetworkCredential("senderemailid or say user name", "password-of-mail-id");
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = nc;
client.Send(message);
}
catch
{
//do your catch job here;
}
}
Hope this helps.