using System; using System.Collections.Specialized; using System.Net.Mime; using System.Text; namespace System.Net.Mail { /// Represents an e-mail message that can be sent using the class. // Token: 0x02000140 RID: 320 public class MailMessage : IDisposable { /// Initializes an empty instance of the class. // Token: 0x06000ADF RID: 2783 RVA: 0x00020884 File Offset: 0x0001EA84 public MailMessage() { this.to = new MailAddressCollection(); this.alternateViews = new AlternateViewCollection(); this.attachments = new AttachmentCollection(); this.bcc = new MailAddressCollection(); this.cc = new MailAddressCollection(); this.replyTo = new MailAddressCollection(); this.headers = new global::System.Collections.Specialized.NameValueCollection(); this.headers.Add("MIME-Version", "1.0"); } /// Initializes a new instance of the class by using the specified class objects. /// A that contains the address of the sender of the e-mail message. /// A that contains the address of the recipient of the e-mail message. /// /// is null.-or- is null. /// /// or is malformed. // Token: 0x06000AE0 RID: 2784 RVA: 0x00020904 File Offset: 0x0001EB04 public MailMessage(MailAddress from, MailAddress to) : this() { if (from == null || to == null) { throw new ArgumentNullException(); } this.From = from; this.to.Add(to); } /// Initializes a new instance of the class by using the specified class objects. /// A that contains the address of the sender of the e-mail message. /// A that contains the addresses of the recipients of the e-mail message. /// /// is null.-or- is null. /// /// is ("").-or- is (""). /// /// or is malformed. // Token: 0x06000AE1 RID: 2785 RVA: 0x00020934 File Offset: 0x0001EB34 public MailMessage(string from, string to) : this() { if (from == null || from == string.Empty) { throw new ArgumentNullException("from"); } if (to == null || to == string.Empty) { throw new ArgumentNullException("to"); } this.from = new MailAddress(from); foreach (string text in to.Split(new char[] { ',' })) { this.to.Add(new MailAddress(text.Trim())); } } /// Initializes a new instance of the class. /// A that contains the address of the sender of the e-mail message. /// A that contains the address of the recipient of the e-mail message. /// A that contains the subject text. /// A that contains the message body. /// /// is null.-or- is null. /// /// is ("").-or- is (""). /// /// or is malformed. // Token: 0x06000AE2 RID: 2786 RVA: 0x000209D8 File Offset: 0x0001EBD8 public MailMessage(string from, string to, string subject, string body) : this() { if (from == null || from == string.Empty) { throw new ArgumentNullException("from"); } if (to == null || to == string.Empty) { throw new ArgumentNullException("to"); } this.from = new MailAddress(from); foreach (string text in to.Split(new char[] { ',' })) { this.to.Add(new MailAddress(text.Trim())); } this.Body = body; this.Subject = subject; } /// Gets the attachment collection used to store alternate forms of the message body. /// A writable . // Token: 0x170002B9 RID: 697 // (get) Token: 0x06000AE3 RID: 2787 RVA: 0x00020A88 File Offset: 0x0001EC88 public AlternateViewCollection AlternateViews { get { return this.alternateViews; } } /// Gets the attachment collection used to store data attached to this e-mail message. /// A writable . // Token: 0x170002BA RID: 698 // (get) Token: 0x06000AE4 RID: 2788 RVA: 0x00020A90 File Offset: 0x0001EC90 public AttachmentCollection Attachments { get { return this.attachments; } } /// Gets the address collection that contains the blind carbon copy (BCC) recipients for this e-mail message. /// A writable object. // Token: 0x170002BB RID: 699 // (get) Token: 0x06000AE5 RID: 2789 RVA: 0x00020A98 File Offset: 0x0001EC98 public MailAddressCollection Bcc { get { return this.bcc; } } /// Gets or sets the message body. /// A value that contains the body text. // Token: 0x170002BC RID: 700 // (get) Token: 0x06000AE6 RID: 2790 RVA: 0x00020AA0 File Offset: 0x0001ECA0 // (set) Token: 0x06000AE7 RID: 2791 RVA: 0x00020AA8 File Offset: 0x0001ECA8 public string Body { get { return this.body; } set { if (value != null && this.bodyEncoding == null) { this.bodyEncoding = this.GuessEncoding(value) ?? Encoding.ASCII; } this.body = value; } } // Token: 0x170002BD RID: 701 // (get) Token: 0x06000AE8 RID: 2792 RVA: 0x00020ADC File Offset: 0x0001ECDC internal global::System.Net.Mime.ContentType BodyContentType { get { return new global::System.Net.Mime.ContentType((!this.isHtml) ? "text/plain" : "text/html") { CharSet = (this.BodyEncoding ?? Encoding.ASCII).HeaderName }; } } // Token: 0x170002BE RID: 702 // (get) Token: 0x06000AE9 RID: 2793 RVA: 0x00020B28 File Offset: 0x0001ED28 internal global::System.Net.Mime.TransferEncoding ContentTransferEncoding { get { return global::System.Net.Mime.ContentType.GuessTransferEncoding(this.BodyEncoding); } } /// Gets or sets the encoding used to encode the message body. /// An applied to the contents of the . // Token: 0x170002BF RID: 703 // (get) Token: 0x06000AEA RID: 2794 RVA: 0x00020B38 File Offset: 0x0001ED38 // (set) Token: 0x06000AEB RID: 2795 RVA: 0x00020B40 File Offset: 0x0001ED40 public Encoding BodyEncoding { get { return this.bodyEncoding; } set { this.bodyEncoding = value; } } /// Gets the address collection that contains the carbon copy (CC) recipients for this e-mail message. /// A writable object. // Token: 0x170002C0 RID: 704 // (get) Token: 0x06000AEC RID: 2796 RVA: 0x00020B4C File Offset: 0x0001ED4C public MailAddressCollection CC { get { return this.cc; } } /// Gets or sets the delivery notifications for this e-mail message. /// A value that contains the delivery notifications for this message. // Token: 0x170002C1 RID: 705 // (get) Token: 0x06000AED RID: 2797 RVA: 0x00020B54 File Offset: 0x0001ED54 // (set) Token: 0x06000AEE RID: 2798 RVA: 0x00020B5C File Offset: 0x0001ED5C public DeliveryNotificationOptions DeliveryNotificationOptions { get { return this.deliveryNotificationOptions; } set { this.deliveryNotificationOptions = value; } } /// Gets or sets the from address for this e-mail message. /// A that contains the from address information. // Token: 0x170002C2 RID: 706 // (get) Token: 0x06000AEF RID: 2799 RVA: 0x00020B68 File Offset: 0x0001ED68 // (set) Token: 0x06000AF0 RID: 2800 RVA: 0x00020B70 File Offset: 0x0001ED70 public MailAddress From { get { return this.from; } set { this.from = value; } } /// Gets the e-mail headers that are transmitted with this e-mail message. /// A that contains the e-mail headers. // Token: 0x170002C3 RID: 707 // (get) Token: 0x06000AF1 RID: 2801 RVA: 0x00020B7C File Offset: 0x0001ED7C public global::System.Collections.Specialized.NameValueCollection Headers { get { return this.headers; } } /// Gets or sets a value indicating whether the mail message body is in Html. /// true if the message body is in Html; else false. The default is false. // Token: 0x170002C4 RID: 708 // (get) Token: 0x06000AF2 RID: 2802 RVA: 0x00020B84 File Offset: 0x0001ED84 // (set) Token: 0x06000AF3 RID: 2803 RVA: 0x00020B8C File Offset: 0x0001ED8C public bool IsBodyHtml { get { return this.isHtml; } set { this.isHtml = value; } } /// Gets or sets the priority of this e-mail message. /// A that contains the priority of this message. // Token: 0x170002C5 RID: 709 // (get) Token: 0x06000AF4 RID: 2804 RVA: 0x00020B98 File Offset: 0x0001ED98 // (set) Token: 0x06000AF5 RID: 2805 RVA: 0x00020BA0 File Offset: 0x0001EDA0 public MailPriority Priority { get { return this.priority; } set { this.priority = value; } } // Token: 0x170002C6 RID: 710 // (get) Token: 0x06000AF6 RID: 2806 RVA: 0x00020BAC File Offset: 0x0001EDAC // (set) Token: 0x06000AF7 RID: 2807 RVA: 0x00020BB4 File Offset: 0x0001EDB4 internal Encoding HeadersEncoding { get { return this.headersEncoding; } set { this.headersEncoding = value; } } // Token: 0x170002C7 RID: 711 // (get) Token: 0x06000AF8 RID: 2808 RVA: 0x00020BC0 File Offset: 0x0001EDC0 internal MailAddressCollection ReplyToList { get { return this.replyTo; } } /// Gets or sets the ReplyTo address for the mail message. /// A MailAddress that indicates the value of the field. // Token: 0x170002C8 RID: 712 // (get) Token: 0x06000AF9 RID: 2809 RVA: 0x00020BC8 File Offset: 0x0001EDC8 // (set) Token: 0x06000AFA RID: 2810 RVA: 0x00020BE8 File Offset: 0x0001EDE8 public MailAddress ReplyTo { get { if (this.replyTo.Count == 0) { return null; } return this.replyTo[0]; } set { this.replyTo.Clear(); this.replyTo.Add(value); } } /// Gets or sets the sender's address for this e-mail message. /// A that contains the sender's address information. // Token: 0x170002C9 RID: 713 // (get) Token: 0x06000AFB RID: 2811 RVA: 0x00020C04 File Offset: 0x0001EE04 // (set) Token: 0x06000AFC RID: 2812 RVA: 0x00020C0C File Offset: 0x0001EE0C public MailAddress Sender { get { return this.sender; } set { this.sender = value; } } /// Gets or sets the subject line for this e-mail message. /// A that contains the subject content. // Token: 0x170002CA RID: 714 // (get) Token: 0x06000AFD RID: 2813 RVA: 0x00020C18 File Offset: 0x0001EE18 // (set) Token: 0x06000AFE RID: 2814 RVA: 0x00020C20 File Offset: 0x0001EE20 public string Subject { get { return this.subject; } set { if (value != null && this.subjectEncoding == null) { this.subjectEncoding = this.GuessEncoding(value); } this.subject = value; } } /// Gets or sets the encoding used for the subject content for this e-mail message. /// An that was used to encode the property. // Token: 0x170002CB RID: 715 // (get) Token: 0x06000AFF RID: 2815 RVA: 0x00020C48 File Offset: 0x0001EE48 // (set) Token: 0x06000B00 RID: 2816 RVA: 0x00020C50 File Offset: 0x0001EE50 public Encoding SubjectEncoding { get { return this.subjectEncoding; } set { this.subjectEncoding = value; } } /// Gets the address collection that contains the recipients of this e-mail message. /// A writable object. // Token: 0x170002CC RID: 716 // (get) Token: 0x06000B01 RID: 2817 RVA: 0x00020C5C File Offset: 0x0001EE5C public MailAddressCollection To { get { return this.to; } } /// Releases all resources used by the . // Token: 0x06000B02 RID: 2818 RVA: 0x00020C64 File Offset: 0x0001EE64 public void Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } /// Releases the unmanaged resources used by the and optionally releases the managed resources. /// true to release both managed and unmanaged resources; false to release only unmanaged resources. // Token: 0x06000B03 RID: 2819 RVA: 0x00020C74 File Offset: 0x0001EE74 protected virtual void Dispose(bool disposing) { } // Token: 0x06000B04 RID: 2820 RVA: 0x00020C78 File Offset: 0x0001EE78 private Encoding GuessEncoding(string s) { return global::System.Net.Mime.ContentType.GuessEncoding(s); } // Token: 0x04000B09 RID: 2825 private AlternateViewCollection alternateViews; // Token: 0x04000B0A RID: 2826 private AttachmentCollection attachments; // Token: 0x04000B0B RID: 2827 private MailAddressCollection bcc; // Token: 0x04000B0C RID: 2828 private MailAddressCollection replyTo; // Token: 0x04000B0D RID: 2829 private string body; // Token: 0x04000B0E RID: 2830 private MailPriority priority; // Token: 0x04000B0F RID: 2831 private MailAddress sender; // Token: 0x04000B10 RID: 2832 private DeliveryNotificationOptions deliveryNotificationOptions; // Token: 0x04000B11 RID: 2833 private MailAddressCollection cc; // Token: 0x04000B12 RID: 2834 private MailAddress from; // Token: 0x04000B13 RID: 2835 private global::System.Collections.Specialized.NameValueCollection headers; // Token: 0x04000B14 RID: 2836 private MailAddressCollection to; // Token: 0x04000B15 RID: 2837 private string subject; // Token: 0x04000B16 RID: 2838 private Encoding subjectEncoding; // Token: 0x04000B17 RID: 2839 private Encoding bodyEncoding; // Token: 0x04000B18 RID: 2840 private Encoding headersEncoding = Encoding.UTF8; // Token: 0x04000B19 RID: 2841 private bool isHtml; } }