using System.Collections;
using System.Configuration;
using System.Data;
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.Data.SqlClient;
using System.Net.Mail;
protected void Page_Load(object sender, EventArgs e)
{
String mailMsg = "Hello, "
objEmail.To.Add("email@yourdomain.com");
objEmail.CC.Add("email@yourdomain.com");
objEmail.From = new MailAddress("email@yourdomain.com", "Company Name");
objEmail.Subject = "Text mail";
objEmail.Body = mailMsg;
objEmail.IsBodyHtml = true;
objEmail.Priority = MailPriority.High;
SmtpClient smtp1 = new SmtpClient();
smtp1.Host = "relay-hosting.secureserver.net";
smtp1.UseDefaultCredentials = false;
smtp1.EnableSsl = false;
try
{
smtp1.Send(objEmail);
objEmail.Dispose();
objEmail = null;
}
catch (Exception exc)
{
string msg = exc.Message;
}
}