Add System.Web.Mail namespace to use mail functionality
using System.Web.Mail;
MailMessage mail = new MailMessage();
SmtpMail.SmtpServer = "100.100.100.100"; //ip of your smptp server 100.100.100.100 is used for an example only, not an excatly ip. so change it by your ip
mail.To = txtemailid.Text;
mail.From = "xxx.cc@abc.com";
mail.Subject = "Try mail sending using asp.net";
string MailBody = "We are trying to send mail using smtp server ..................";
mail.Body = MailBody;
SmtpMail.Send(mail);