Exception handling class for Email();
For a list of all members of this type, see EmailException Members.
System.Object
Exception
EmailException
This class is created internally, and thrown to outside callers.
[C#]
EmailMessage msg = new EmailMessage( "Mail.MyCompany.com" );
msg.FromAddress = "me@MyCompany.com";
msg.To = "you@YourCompany.com";
msg.Subject = "Daily Newsletter";
msg.Body = "Here is our daily newsletter.....";
try
{
msg.Send();
}
catch( EmailException emailException )
{
Console.WriteLine( "The following email exception occurred while sending: {0}", emailException );
}
catch( Exception ex )
{
Console.WriteLine( "The following exception occurred: {0} ", ex );
}
[Visual Basic]
Dim msg As New EmailMessage("Mail.MyCompany.com")
/// msg.FromAddress = "me@MyCompany.com"
msg.To = "you@YourCompany.com"
msg.Subject = "Daily Newsletter"
msg.Body = "Here is our daily newsletter....."
Try
msg.Send()
Catch emailException As EmailException
Console.WriteLine("The following email exception occurred while sending: {0}", emailException)
Catch ex As Exception
Console.WriteLine("The following exception occurred: {0} ", ex)
End Try
Namespace: aspNetEmail
Assembly: aspNetEmail (in aspNetEmail.dll)