You can use this code. Replace from@abc.com and password from sender emailid and senderpassword respectively.
private void email()
{
try
{
StringBuilder emailMessage = new StringBuilder();
emailMessage.Append("Hi have a nice day");
MailMessage email = new MailMessage();
email.From = new MailAddress("from@abc.com");
email.To.Add(new MailAddress(emailAddress));
email.Subject = "Email Subject";
email.Body = emailMessage.ToString();
email.IsBodyHtml = true;
System.Net.NetworkCredential mailAuthentication = new System.Net.NetworkCredential("from@abc.com", "password");
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("smtpout.secureserver.net");
client.EnableSsl = false;
client.UseDefaultCredentials = false;
client.Credentials = CredentialCache.DefaultNetworkCredentials;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Credentials = mailAuthentication;
client.Send(email);
Response.Write("message sent");
}
catch (Exception ex)
{
Response.Write(ex.Message);
}