using System.Web.Mail; // Create message MailMessage msgMail = new MailMessage(); // Set message properties msgMail.From = txtFrom.Text; msgMail.To = txtTo.Text; msgMail.Subject = txtSubject.Text; msgMail.Body = txtMessage.Text; // Send message SmtpMail.SmtpServer="localhost"; SmtpMail.Send(msgMail); // Clear form fields txtTo.Text = ""; txtSubject.Text = ""; txtMessage.Text = ""; // Show success litStatus.Text = "Message sent";
Message sent