Posts

Showing posts from October, 2009

Send Email in asp.net

add System.Net.Mail; namespace ///*********************************************************************************     ///     ///To Send the simple  Email     ///     /// From Email Id     /// To Email Id     /// Email Subject     /// Email Body     /// Returns bool with Indication     ///*********************************************************************************     public bool SendEMail(string FromAddressId, string ToAddressId,                           string Subject, string MessageBody)     {         SmtpClient objSmtpClient = new SmtpClient();         MailMessage message = new MailMessage();         try         {             MailAddress fromAddress = new MailAddress(FromAddressId);             objSmtpClient.Host = SmtpServerName;             objSmtpClient.Port = SmtpServerPortNo;             message.From = fromAddress;             message.To.Add(ToAddressId);             message.Subject = Subject;             message.IsBodyHtml = true;           

Creating Error log

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; using CommonComponents; using System.IO; /// /// Summary description for clsErrorLog /// public class clsErrorLog {     /*************************************************************     NAME:          WriteToErrorLog     PURPOSE:       Open or create an error log and submit error message     PARAMETERS:    ex - object of Exception class                    ErrorTitle - title of the error                    ErrorClass - name of form or class in which error occured                            ErrorMethod - name of the method in which error occured     RETURNS:       Nothing            '*************************************************************/     ///     /// Open or create an error log and su