Code to send email
Hi, below is the code to send the email.
First of all make changes in web config file in "app settings"
i.e.
<add key="SMTPServer" value="mail.test.com"/>
<add key="MailUserName" value="admin@test.com"/>
<add key="MailPassword" value="password"/>
Then use namespace on source code file.
i.e.
using System.Net.Mail;
Now write down the below code on button click (on which you want to send email.)with required perameter. i.e.
SmtpClient objSMTP = new SmtpClient(ConfigurationManager.AppSettings ["SMTPServer"].ToString());
objSMTP.Credentials = new System.Net.NetworkCredential(
ConfigurationManager.AppSettings["MailUserName"].ToString(),
ConfigurationManager.AppSettings["MailPassword"].ToString());
MailMessage objMailMessage = new MailMessage();
objMailMessage.From = new MailAddress(ConfigurationManager.AppSettings["MailUserName"].ToString());
objMailMessage.Subject = "Test mail";
objMailMessage.To.Add(new MailAddress(EmailAddress));
objMailMessage.Body = "Hi, this is a text mail.
objMailMessage.IsBodyHtml = true;
objSMTP.Send(objMailMessage);
lblMsg.Visible = true;
lblMsg.Text = "Mail has been sent.";
Regards
Vivek Sharma

HI,
Is Your code is working from any mail id to anyone?
or Anyone id shoule be a abc@test.com