943,822 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 1348
  • ASP.NET RSS
Jul 23rd, 2008
0

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
Last edited by matale; Jul 23rd, 2008 at 4:34 pm.
Similar Threads
Reputation Points: 22
Solved Threads: 1
Light Poster
matale is offline Offline
38 posts
since May 2007
Jul 24th, 2008
0

Re: How to send email to site Admin when a new user registers?

ASP.NET Syntax (Toggle Plain Text)
  1. void SendMailToStudent()
  2. {
  3. MailMessage stdmsg = new MailMessage("from@co.org", "to@co.org");
  4. SmtpClient smtp = new SmtpClient();
  5.  
  6. stdmsg.Subject = "Acknowledgement for Student Application";
  7. stdmsg.IsBodyHtml = true;
  8.  
  9. stdmsg.Body = "";
  10. stdmsg.Priority = MailPriority.High;
  11.  
  12. smtp.Host = "localhost";
  13.  
  14. // StdMsg.Subject = "Acknowledgement for Student Application";
  15. //stdmsg.IsBodyHtml = true;
  16.  
  17.  
  18. try
  19. {
  20.  
  21. smtp.Send(stdmsg);
  22. }
  23. catch (Exception ex)
  24. {
  25. lblAgmtMsg.Text = "Error : " + ex.Message;
  26. }
  27. }
u can use this to send mail
Last edited by Tekmaven; Jul 24th, 2008 at 3:20 am. Reason: Code tags
Reputation Points: 25
Solved Threads: 29
Posting Whiz
greeny_1984 is offline Offline
372 posts
since Apr 2007
Jul 24th, 2008
0

Re: How to send email to site Admin when a new user registers?

ASP.NET Syntax (Toggle Plain Text)
  1. void SendMailToStudent()
  2. {
  3. MailMessage stdmsg = new MailMessage("from@co.org", "to@co.org");
  4. SmtpClient smtp = new SmtpClient();
  5.  
  6. stdmsg.Subject = "Acknowledgement for Student Application";
  7. stdmsg.IsBodyHtml = true;
  8.  
  9. stdmsg.Body = "";
  10. stdmsg.Priority = MailPriority.High;
  11.  
  12. smtp.Host = "localhost";
  13.  
  14. // StdMsg.Subject = "Acknowledgement for Student Application";
  15. //stdmsg.IsBodyHtml = true;
  16.  
  17.  
  18. try
  19. {
  20.  
  21. smtp.Send(stdmsg);
  22. }
  23. catch (Exception ex)
  24. {
  25. lblAgmtMsg.Text = "Error : " + ex.Message;
  26. }
  27. }
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
Reputation Points: 22
Solved Threads: 1
Light Poster
matale is offline Offline
38 posts
since May 2007
Jul 24th, 2008
0

Re: How to send email to site Admin when a new user registers?

Ok I think I found it. The CreatedUser event is raised everytime a new user registers, so i can stick the code in there.
thanx
Reputation Points: 22
Solved Threads: 1
Light Poster
matale is offline Offline
38 posts
since May 2007
Jul 26th, 2008
0

Re: How to send email to site Admin when a new user registers?

mark the thread as solved
Reputation Points: 25
Solved Threads: 29
Posting Whiz
greeny_1984 is offline Offline
372 posts
since Apr 2007

This thread is more than three months old

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.
Message:
Previous Thread in ASP.NET Forum Timeline: how to print asp.net data in printdivice
Next Thread in ASP.NET Forum Timeline: textbox suggest





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC