hai all,
can any one help me that...howto send conformation email to the respective email holder
thanks
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Sunny SharmaRank #223 · 11.1K reputationPosted Jun 2, 2013, 11:36 PM EDT
please follow the code below:
----------------------------------------------------------------
private bool SendEmail()
{
bool EmailSent = false;
SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
smtp.EnableSsl = true;
smtp.Credentials = new NetworkCredential("[email protected]", "yourPasswordHere");
MailMessage message = new MailMessage("[email protected]", "[email protected]");
message.IsBodyHtml = true;// If you want to send HTML contents;
message.Body = "
Hi!
This is a test mail.
";Thanks
try
{
smtp.Send(message);
EmailSent = true;
}
catch (Exception ex)
{
// Handle the exception here
}
return EmailSent;
}
--------------------------------------------------------------------------------
Also, a true/false is implemented to return in case you might want to check if the email was sent successfully.
Happy Coding :)
Please don't forget to accept this as answer if it help!
Thanks.
Pankaj PandeyRank #642 · 3.7K reputationPosted Jun 3, 2013, 3:06 AM EDT
{
SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
smtp.EnableSsl = true;
smtp.Credentials = new NetworkCredential("[email protected]", "yourPasswordHere");
MailMessage message = new MailMessage("[email protected]", "[email protected]");
message.IsBodyHtml = true;
message.Body = "
Hi!
http://www.abc.com/confirm.aspx?userid=123&activationcode=234
";click here to confirm !!!
try
{
smtp.Send(message);
}
catch (Exception ex)
{
// Handle the exception here
}
}
http://www.abc.com/confirm.aspx?userid=123&activationcode=234 you have to match userid and activation code on confirm.aspx page....
if matches then confirm activation.