aspNetEmail

EmailMessage.LogExceptionToEventLog Property

Setting ExceptionsToAppLog will log any exceptions to the windows application event log.

public bool LogExceptionToEventLog {get; set;}

Remarks

Be sure you have permissions to write to the application log, or an unhandled exception will be thrown.

Example

[C#]
		EmailMessage msg = new EmailMessage( "mail.MyCompany.com" );
		msg.FromAddress = "me@MyCompany.com";
		msg.To = "you@YourCompany.com";
		msg.LogExceptionToEventLog = true;
		msg.Subject = "Daily Newsletter";
		msg.Body = "Here is our daily newsletter.....";
		msg.Send();
		
[Visual Basic]
		Dim msg As New EmailMessage("mail.MyCompany.com")
		msg.FromAddress = "me@MyCompany.com"
		msg.To = "you@YourCompany.com"
		msg.LogExceptionToEventLog = True
		msg.Subject = "Daily Newsletter"
		msg.Body = "Here is our daily newsletter....."
		msg.Send()
		

See Also

EmailMessage Class | aspNetEmail Namespace