Guys I am trying to send mail through SMTP server. I am sending the mail using this code,
using(System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage())
{
message.To.Add(textBox1.Text); //TextBox1 = Send To
message.Subject = textBox2.Text; //TextBox2 = Subject
message.From = new System.Net.Mail.MailAddress("email id");
message.Body = textBox3.Text; //TextBox3 = Message Body
using(System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient())
{
smtp.Host = "smtp.server.com";
smtp.Credentials = new System.Net.NetworkCredential("user", "pass");
smtp.Send(message);
}
}
Now this code works perfectly. Now I want to send a whole form in the body of the mail, like selecting values of multiple textboxes. This is the form, I want to send in the mail :
How can I design a message template so that it may send a message with body containing all the values you see in the above form?