System.Web 2.0.0.0 System.EventArgs

The object contains an error message that is raised by the SMTP mail provider when an e-mail message cannot be sent by the control, or the control. In such a case, the object is sent to the .

Create a delegate to handle the event. Handling the event allows your Web application to continue to run even though an exception has occurred. This is useful when it is not critical to send an e-mail message. For example, if the exception occurs when a user is working through a multi-step wizard, it can be advantageous to log the error, display an informative message to the user, and allow the user to complete the wizard.

Examine the property to determine the actual cause of the exception. The most common reason for the exception is a configuration error in the smtp Element (Network Settings) of the machine configuration file. Although an error like this is typically discovered during the development and debugging of an application, mail servers can fail unexpectedly in a production environment, and you must determine whether you want the entire application to fail in that situation. If not, handling the event allows your application to proceed.

You must set the property to true to signal that the exception has been handled; otherwise, the exception is rethrown, and will include the original call stack and error message.

If you do not create an event handler for the event, or if you create an event handler but leave the property set to false, your Web application will stop running if an error occurs when sending an e-mail message, and ASP.NET will display an error message.

The method also allows derived classes to handle the event, instead of this being done by the . This is the preferred technique for handling the event in a class that is derived from or .

For more information about handling events, see Server Event Handling in ASP.NET Web Pages.

Provides data for the SendMailError event of controls such as the control, the control, and the control.

- Constructor
  To be added.

  Initializes a new instance of the class.

  An object containing the exception.
  2.0.0.0
- Property
  System.Exception To be added.

  The property contains the exception that is thrown by the SMTP mail provider when an e-mail message cannot be sent by the control or the . The most common reason for this exception is a configuration error in the smtp Element (Network Settings) of the machine configuration file, which produces the following exception message: The transport failed to connect to the server.

  Exceptions are not thrown if there is an error in the e-mail message when embedding a file using . Instead, the embedded file appears broken when the mail message is viewed.

  You must set the object, passed as the parameter of , to true to signal that the exception has been handled; otherwise, the exception is rethrown, and includes the original call stack and error message.

  Returns the exception thrown by an SMTP mail service when an e-mail message cannot be sent.

  2.0.0.0
- Property
  System.Boolean To be added.

  The property indicates if the has been handled. The exception is raised by the SMTP mail provider when an e-mail message cannot be sent by the control or the . The most common reason for the exception is a configuration error in the smtp Element (Network Settings) of the machine configuration file. Although an error like this is typically discovered during the development and debugging of an application, mail servers can fail unexpectedly in a production environment, and you must determine whether you want the entire application to fail in that situation. If not, handling the event allows your application to proceed.

  If you do not create an event handler for the event, or if you create an event handler but leave the property set to false, your Web application will stop running if an error occurs when sending an e-mail message, and ASP.NET will display an error message. Handling the event allows your Web application to continue to run even though an exception has occurred. This is useful when it is not critical to send an e-mail message. For example, if the exception occurs when a user is working through a multi-step wizard, it can be advantageous to log the error, display an informative message to the user, and allow the user to complete the wizard.

  Indicates if the SMTP exception that is contained in the property has been handled.

  2.0.0.0