ASP.NET Page /Admin/SendCorrespondence.aspx.cs (C#)
1: using System;  
2: using System.Data;  
3: using System.Configuration;  
4: using System.Collections;  
5: using System.Web;  
6: using System.Web.Security;  
7: using System.Web.UI;  
8: using System.Web.UI.WebControls;  
9: using System.Web.UI.WebControls.WebParts;  
10: using System.Web.UI.HtmlControls;  
11: using QuizNetOnline.Logic;  
12:   
13: public partial class Admin_SendCorrespondence : System.Web.UI.Page  
14: {  
15:     protected void Page_Load(object sender, EventArgs e)  
16:     {  
17:         //Page.Title = "Send Correspondence" + QuizNetSystem.GetVersion();  
18:     }  
19:     protected void cmdSendEmail_Click(object sender, EventArgs e)  
20:     {  
21:         QuizNetSystem quizNetSystem = new QuizNetSystem();  
22:   
23:         try  
24:         {  
25:             string[] UserNameArr=txtTo.Text.Split(';');  
26:   
27:             foreach (string strUser in UserNameArr)  
28:             {  
29:                 quizNetSystem.SendEmail(strUser.Trim(), txtSubject.Text, txtMessage.Text, true,false);  
30:             }  
31:         }  
32:         catch (Exception)  
33:         {  
34:             Response.Write("<center><strong>Serious Error occured. Email not sent");  
35:             return;  
36:         }  
37:   
38:         Type cstype = this.GetType();  
39:         ClientScriptManager cs = Page.ClientScript;  
40:   
41:         // Check to see if the startup script is already registered.  
42:         if (!cs.IsStartupScriptRegistered(cstype, "clientScript"))  
43:         {  
44:             cs.RegisterStartupScript(cstype, "clientScript", "<script language='javascript'>alert('Email Sent')</script>", false);  
45:         }  
46:     }  
47: }  

.NET Documentation Tool is © 2002 - 2009 Winnersh Triangle Web Solutions Limited.