Muokkaa

Jaa


SendMailErrorEventArgs.Exception Property

Definition

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

public:
 property Exception ^ Exception { Exception ^ get(); void set(Exception ^ value); };
public Exception Exception { get; set; }
member this.Exception : Exception with get, set
Public Property Exception As Exception

Property Value

An Exception object that contains the exception.

Remarks

The Exception property contains the exception that is thrown by the SMTP mail provider when an email message cannot be sent by the ChangePassword control or the CreateUserWizard. 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 email message when embedding a file using EmbeddedObjects. Instead, the embedded file appears broken when the mail message is viewed.

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

Applies to

See also