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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankaj PandeyPosted Jun 3, 2013, 7:06 AM
{
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.
Sunny SharmaPosted Jun 3, 2013, 3:36 AM
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.