using System; using System.Data; using System.Configuration; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Web.Mail; using System.Net.Mail; public class EmailManagment { SmtpClient client = new SmtpClient(); System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(); System.Net.NetworkCredential credentials = new System.Net.NetworkCredential("emailus@eventsitsolution.com", "mypassword"); public void sendemail(string sendto, string subject, string body) { try { client.Host = "smtpout.secureserver.net"; client.Port = 80; client.UseDefaultCredentials = false; client.Credentials = credentials; client.EnableSsl = false; // convert strings to mail address MailAddress to = new MailAddress(sendto); MailAddress from = new MailAddress("emailus@eventsitsolution.com"); // msg.Subject = subject; msg.Body = body; msg.To.Add(to); msg.From = from; msg.IsBodyHtml = true; client.Send(msg); } catch (Exception ex) { ex.ToString(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)