Try this...
public static bool SendMail(string From, string To, string Subject, string Body)
{
MailMessage msg = new MailMessage(From, To, Subject, Body);
System.Net.NetworkCredential acc = new System.Net.NetworkCredential("Your Email", "Your Password");
SmtpClient srv = new SmtpClient("Your SMTP Server");
srv.UseDefaultCredentials = true;
srv.Credentials = acc;
msg.Priority = MailPriority.High;
msg.IsBodyHtml = true;
try
{
srv.Send(msg);
return true;
}
catch
{
return false;
}
}
Here,
Your Email= An email address, which was created using your SMPT server. Like "abc@test.com"
Your Password= Password of your email.
Your SMTP Server= A SMPT server of your domain. Like "mail.test.com", here "www.test.com" your domain.