How to send email to site Admin when a new user registers?
Expand Post »
Hi,
Im using ASP.net Login controls to allow users to Register on my website. I want an Email to be sent to the site Administrator everytime a new user registers, how do I achieve this?
Thanx
MailMessage stdmsg = new MailMessage("from@co.org", "to@co.org");
SmtpClient smtp = new SmtpClient();
stdmsg.Subject = "Acknowledgement for Student Application";
stdmsg.IsBodyHtml = true;
stdmsg.Body = "";
stdmsg.Priority = MailPriority.High;
smtp.Host = "localhost";
// StdMsg.Subject = "Acknowledgement for Student Application";
//stdmsg.IsBodyHtml = true;
try
{
smtp.Send(stdmsg);
}
catch(Exception ex)
{
lblAgmtMsg.Text = "Error : " + ex.Message;
}
}
u can use this to send mail
Maybe I didnt explain correctly. The question is how do I trigger the sending of the email when a user registers on my site, using the UserRegistration Wizard? Meaning how do I detect the successul registration of a user and call the SendMailToStudent Function
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.