i have host and a site.
everybody register in site I want to send him/her a mail automatically to verify his/her registration.
pls guide me.
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.
AnkurPosted Sep 14, 2010, 2:11 AM
please select appropriate category before posting ; the category you have selected is Windows forms, but the problem mentioned is of ASP.Net, it might confuse users while helping you.
Thanks and Regards
AnkurPosted Sep 14, 2010, 2:05 AM
i think following might help:
asp.Net CreateUserWizard facilitates the sending email process by assigning an eventhandler like:
ShankeyPosted Sep 14, 2010, 1:27 AM
You can do this by including below smpt settings in config file of your site, and can sent mail using below c# code on registeration of user: but mark my answer as accepted if it helped you a little.
web config;
C# code:
try
{
MailMessage objEmail = new MailMessage();
objEmail.From = new MailAddress(fromemailid, strDisplayName);
objEmail.To.Add(new MailAddress(emailid));
objEmail.Subject = HttpUtility.HtmlDecode(Subject);
objEmail.Body = HttpUtility.HtmlDecode(strMsg);
objEmail.IsBodyHtml = true;
objEmail.Priority = MailPriority.Normal;
SmtpClient client = new System.Net.Mail.SmtpClient();
client.Send(objEmail);
}
catch (Exception ex)
{
HttpContext.Current.Response.Write(ex.Message);
}