oder einfach log4net mit SmtpAppender benutzen Grüße Daniel
Oskar O wrote:
in der global.asax: void Application_OnError(object sender, EventArgs e) { if (Request.Url.Host != "localhost") { Exception ex = Server.GetLastError().InnerException; MailMessage mail = new MailMessage(); mail.From = "emailadresse"; mail.To = "emailadresse"; mail.Subject = "Fehler auf " + Request.Url.Host; mail.Body = "Datum und Zeit: " + DateTime.Now.ToString() + " \r\n \r\n"; mail.Body += "Fehler: " + ex.Message + " \r\n \r\n"; mail.Body += "Quelle: " + ex.Source + " \r\n \r\n"; mail.Body += "Stapelüberwachung: " + ex.StackTrace + " \r\n \r\n"; mail.Body += "Methode: " + ex.TargetSite + " \r\n \r\n"; mail.Body += "Hilfe: " + ex.HelpLink + " \r\n \r\n \r\n \r\n"; mail.Body += "Port: " + Request.Url.Port + " \r\n \r\n"; mail.Body += "Absolute URL: " + Request.Url.AbsoluteUri + " \r\n"; mail.Body += "Physikalischer Pfad: " + Request.PhysicalPath + " \r\n \r\n";mail.Body += "Remote Adresse: " + Request.ServerVariables["REMOTE_ADDR"] + " \r\n \r\n"; mail.Body += "Remote Host: " + Request.ServerVariables["REMOTE_HOST"] + " \r\n \r\n"; mail.Body += "User Agent: " + Request.ServerVariables["HTTP_USER_AGENT"] + " \r\n \r\n"; mail.Body += "Referrer: " + Request.ServerVariables["HTTP_REFERER"] + " \r\n \r\n"; mail.Body += "Querystring: " + Request.ServerVariables["QUERY_STRING"] + " \r\n \r\n";mail.Body += "Cookies: \r\n"; foreach(string name in Request.Cookies) { mail.Body += Request.Cookies[name].Name + "\r\n"; mail.Body += Request.Cookies[name].Expires + "\r\n"; foreach(string content in Request.Cookies[name].Values) { mail.Body += Request.Cookies[name].Values[content] + "\r\n"; } mail.Body += "\r\n"; } mail.Body += "Formularelemente: \r\n"; foreach(string name in Request.Form) { mail.Body = mail.Body + name + ": " + Request.Form[name] + "\r\n"; } mail.Body += "\r\n \r\n \r\n";mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1; mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = "kontoname"; mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = "passwort";SmtpMail.SmtpServer = "smtpserver"; try { SmtpMail.Send(mail); } catch { // } } } hilft das? lg, oskar _______________________________________________ Asp.net Mailingliste, Postings senden an: [email protected] An-/Abmeldung und Suchfunktion unter: http://www.glengamoi.com/mailman/listinfo/asp.net
_______________________________________________ Asp.net Mailingliste, Postings senden an: [email protected] An-/Abmeldung und Suchfunktion unter: http://www.glengamoi.com/mailman/listinfo/asp.net
