Click here to Skip to main content
15,888,050 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Save data from a html table to database Pin
Abhishek Sur23-Sep-09 0:03
professionalAbhishek Sur23-Sep-09 0:03 
QuestionDATASET refresh every second - problem Pin
j_u_sankar22-Sep-09 20:43
j_u_sankar22-Sep-09 20:43 
AnswerRe: DATASET refresh every second - problem Pin
Vimalsoft(Pty) Ltd23-Sep-09 0:29
professionalVimalsoft(Pty) Ltd23-Sep-09 0:29 
QuestionCrystal Sub-report displaying the redundant records... Pin
jmk_cooljack22-Sep-09 20:42
jmk_cooljack22-Sep-09 20:42 
Questionemail Pin
mylogics22-Sep-09 20:27
professionalmylogics22-Sep-09 20:27 
AnswerRe: email Pin
Ravi Mori22-Sep-09 20:35
Ravi Mori22-Sep-09 20:35 
AnswerRe: email Pin
Abhijit Jana22-Sep-09 21:11
professionalAbhijit Jana22-Sep-09 21:11 
AnswerRe: email Pin
Vimalsoft(Pty) Ltd23-Sep-09 0:34
professionalVimalsoft(Pty) Ltd23-Sep-09 0:34 
i have just did a copy and Paste from my old Function that does that when ever there is an Erro on my applicatin

private void Send_log()
   {
       String Client_Domain = System.Environment.MachineName.ToString(); //This is used Because we needed to know where was the Exception comming from

       Exception objErr = Server.GetLastError();

       String FromE = ConfigurationManager.AppSettings.Get("FromE");

       String To_1 = ConfigurationManager.AppSettings.Get("EmailTO1");

       String To_2 = ConfigurationManager.AppSettings.Get("EmailTO2");

       String Gmail_Password = ConfigurationManager.AppSettings.Get("Gmail_Password");

       String Networked_Username = ConfigurationManager.AppSettings.Get("Networked_Username");

       int Gmailport = Convert.ToInt32(ConfigurationManager.AppSettings.Get("Gmailport"));

       String Server_Host = Convert.ToString(ConfigurationManager.AppSettings.Get("GmailHost"));

       String Body = Convert.ToString(Application["testError"]);

       System.Environment.UserDomainName.ToString();

       try
       {

           if (Body != "")
           {

               MailMessage mm = new MailMessage();

               SmtpClient smtp = new SmtpClient();

               mm.From = new MailAddress(FromE);

               mm.To.Add(new MailAddress(To_1));

               mm.To.Add(new MailAddress(To_2));

               mm.Subject = "Exception Report from " + Client_Domain + "In EXAM/CLASS";

               mm.Body = Body;

               mm.IsBodyHtml = true;

               smtp.Host = Server_Host;

               smtp.EnableSsl = true;

               System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();

               NetworkCred.UserName = Networked_Username;

               NetworkCred.Password = Gmail_Password;

               smtp.UseDefaultCredentials = true;

               smtp.Credentials = NetworkCred;

               smtp.Port = Gmailport;

               smtp.Send(mm);
           }
           else
           {
               MailMessage mm = new MailMessage();

               SmtpClient smtp = new SmtpClient();

               mm.From = new MailAddress(FromE);

               mm.To.Add(new MailAddress(To_1));

               mm.To.Add(new MailAddress(To_2));

               mm.Subject = "Exception Report from " + Client_Domain + "In EXAM/CLASS";

               mm.Body = "An Exception Occured, but it has not Been Realised.You can Wait for the Client to log a Fault";

               mm.IsBodyHtml = true;

               smtp.Host = Server_Host;

               smtp.EnableSsl = true;

               System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();

               NetworkCred.UserName = Networked_Username;

               NetworkCred.Password = Gmail_Password;

               smtp.UseDefaultCredentials = true;

               smtp.Credentials = NetworkCred;

               smtp.Port = Gmailport;

               smtp.Send(mm);
           }
       }
       catch (ApplicationException ex)
       {
           Response.Write(ex.Message);
       }
   }


as you can see the code, the values are comming from a webConfig, you can change them so that they come from your ASP.NET page.

Vuyiswa Maseko,

Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/

QuestionASP.NET Membership Pin
Illegal Operation22-Sep-09 18:56
Illegal Operation22-Sep-09 18:56 
AnswerRe: ASP.NET Membership Pin
Nisha Agrawal23-Sep-09 3:10
Nisha Agrawal23-Sep-09 3:10 
QuestionContent-Disposition attachment not working in IE 7 Pin
sudhirBirlapur22-Sep-09 18:45
sudhirBirlapur22-Sep-09 18:45 
AnswerRe: Content-Disposition attachment not working in IE 7 Pin
S.Dhanasekaran23-Sep-09 0:51
S.Dhanasekaran23-Sep-09 0:51 
QuestionNeed help with dynamic load of several control instances Pin
Michael Eber22-Sep-09 14:19
Michael Eber22-Sep-09 14:19 
AnswerRe: Need help with dynamic load of several control instances Pin
N a v a n e e t h22-Sep-09 15:54
N a v a n e e t h22-Sep-09 15:54 
GeneralRe: Need help with dynamic load of several control instances [modified] Pin
Michael Eber25-Sep-09 13:42
Michael Eber25-Sep-09 13:42 
QuestionProgrammatically set the DataFormatString of a GridView column Pin
David Mujica22-Sep-09 10:22
David Mujica22-Sep-09 10:22 
AnswerRe: Programmatically set the DataFormatString of a GridView column Pin
Abhishek Sur22-Sep-09 12:09
professionalAbhishek Sur22-Sep-09 12:09 
AnswerRe: Programmatically set the DataFormatString of a GridView column Pin
Nisha Agrawal23-Sep-09 3:14
Nisha Agrawal23-Sep-09 3:14 
AnswerResolved - for now Pin
David Mujica23-Sep-09 9:26
David Mujica23-Sep-09 9:26 
GeneralRe: Resolved - for now Pin
Nisha Agrawal23-Sep-09 20:07
Nisha Agrawal23-Sep-09 20:07 
GeneralRe: Resolved - for now Pin
David Mujica24-Sep-09 0:40
David Mujica24-Sep-09 0:40 
Questionalert messages --- title Pin
Hemant Thaker22-Sep-09 8:50
Hemant Thaker22-Sep-09 8:50 
AnswerRe: alert messages --- title Pin
Abhijit Jana22-Sep-09 8:55
professionalAbhijit Jana22-Sep-09 8:55 
AnswerRe: alert messages --- title Pin
Manas Bhardwaj22-Sep-09 9:01
professionalManas Bhardwaj22-Sep-09 9:01 
AnswerRe: alert messages --- title Pin
egenis22-Sep-09 19:19
egenis22-Sep-09 19:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.