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.
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 attend5days leftRegister
ShankeyRank #972 · 2.1K reputationPosted Sep 13, 2010, 9:27 PM EDT
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);
}
AnkurRank #1,353 · 1.2K reputationPosted Sep 13, 2010, 10:05 PM EDT
i think following might help:
asp.Net CreateUserWizard facilitates the sending email process by assigning an eventhandler like:
so first you need an text file say EmailVerify.txt: You requested to register on our Web site with the following: Username: please verify following link to complete the registration process: http://www.abc.com/verifyEmail.aspx?EmailId= Thank you for creating an account with our Web site. then in aspx: "Createuserwizard1" runat="server" maildefinition-bodyfilename="EmailVerify.txt" maildefinition-from="sender account email here" onsendingmail="Createuserwizard1_SendingMail"> then in cs: void Createuserwizard1_SendingMail(object sender, MailMessageEventArgs e) { e.Message.IsBodyHtml = true; e.Message.Subject = "Verify Email"; e.Message.Body = e.Message.Body.Replace("", Createuserwizard1.UserName); e.Message.Body = e.Message.Body.Replace("", Createuserwizard1.Email); //use sending class or code to send email } Thanks and RegardsAnkurRank #1,353 · 1.2K reputationPosted Sep 13, 2010, 10:11 PM EDT
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