using System; using System.Runtime.Serialization; namespace System.Net.Mail { /// Represents the exception that is thrown when the is not able to complete a or operation. // Token: 0x0200014A RID: 330 [Serializable] public class SmtpException : Exception, ISerializable { /// Initializes a new instance of the class. // Token: 0x06000B50 RID: 2896 RVA: 0x00022D68 File Offset: 0x00020F68 public SmtpException() : this(SmtpStatusCode.GeneralFailure) { } /// Initializes a new instance of the class with the specified status code. /// An value. // Token: 0x06000B51 RID: 2897 RVA: 0x00022D74 File Offset: 0x00020F74 public SmtpException(SmtpStatusCode statusCode) : this(statusCode, "Syntax error, command unrecognized.") { } /// Initializes a new instance of the class with the specified error message. /// A that describes the error that occurred. // Token: 0x06000B52 RID: 2898 RVA: 0x00022D84 File Offset: 0x00020F84 public SmtpException(string message) : this(SmtpStatusCode.GeneralFailure, message) { } /// Initializes a new instance of the class from the specified instances of the and classes. /// A that contains the information required to serialize the new . /// A that contains the source and destination of the serialized stream associated with the new instance. // Token: 0x06000B53 RID: 2899 RVA: 0x00022D90 File Offset: 0x00020F90 protected SmtpException(SerializationInfo info, StreamingContext context) : base(info, context) { try { this.statusCode = (SmtpStatusCode)((int)info.GetValue("Status", typeof(int))); } catch (SerializationException) { this.statusCode = (SmtpStatusCode)((int)info.GetValue("statusCode", typeof(SmtpStatusCode))); } } /// Initializes a new instance of the class with the specified status code and error message. /// An value. /// A that describes the error that occurred. // Token: 0x06000B54 RID: 2900 RVA: 0x00022E0C File Offset: 0x0002100C public SmtpException(SmtpStatusCode statusCode, string message) : base(message) { this.statusCode = statusCode; } /// Initializes a new instance of the class with the specified error message and inner exception. /// A that describes the error that occurred. /// The exception that is the cause of the current exception. // Token: 0x06000B55 RID: 2901 RVA: 0x00022E1C File Offset: 0x0002101C public SmtpException(string message, Exception innerException) : base(message, innerException) { this.statusCode = SmtpStatusCode.GeneralFailure; } /// Populates a instance with the data needed to serialize the . /// A , which holds the serialized data for the . /// A that contains the destination of the serialized stream associated with the new . // Token: 0x06000B56 RID: 2902 RVA: 0x00022E30 File Offset: 0x00021030 void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { this.GetObjectData(info, context); } /// Gets the status code returned by an SMTP server when an e-mail message is transmitted. /// An value that indicates the error that occurred. // Token: 0x170002D8 RID: 728 // (get) Token: 0x06000B57 RID: 2903 RVA: 0x00022E3C File Offset: 0x0002103C // (set) Token: 0x06000B58 RID: 2904 RVA: 0x00022E44 File Offset: 0x00021044 public SmtpStatusCode StatusCode { get { return this.statusCode; } set { this.statusCode = value; } } /// Populates a instance with the data needed to serialize the . /// The to populate with data. /// A that specifies the destination for this serialization. // Token: 0x06000B59 RID: 2905 RVA: 0x00022E50 File Offset: 0x00021050 public override void GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) { throw new ArgumentNullException("info"); } base.GetObjectData(info, context); info.AddValue("Status", this.statusCode, typeof(int)); } // Token: 0x04000B57 RID: 2903 private SmtpStatusCode statusCode; } }