MailMessage mail = new MailMessage(); mail.From = new MailAddress("contacts@website.com"); mail.To.Add(DropDownList1.SelectedValue); mail.Subject = txtSubject.Text; mail.Body = "<div>something...</div>"; mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient("mailserver.com"); smtp.Credentials = new NetworkCredential("contacts@website.com","password"); smtp.Send(mail);
<pre lang="xml"><system.net> <mailSettings> <smtp> <network defaultCredentials="false"/> </smtp> </mailSettings> </system.net>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)