| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- // MailMessageWrapper.cs
- // author: Per Arneng <[email protected]>
- using System;
- using System.Collections;
- using System.Text;
- namespace System.Web.Mail {
- internal class MailMessageWrapper {
-
- private MailAddressCollection bcc = new MailAddressCollection();
- private MailAddressCollection cc = new MailAddressCollection();
- private MailAddress from;
- private MailAddressCollection to = new MailAddressCollection();
- private MailMessage message;
-
- // Constructor
- public MailMessageWrapper( MailMessage message )
- {
- this.message = message;
-
- if(message.From != null ) from = MailAddress.Parse( message.From );
- if(message.To != null ) to = MailAddressCollection.Parse( message.To );
- if(message.Cc != null )cc = MailAddressCollection.Parse( message.Cc );
- if(message.Bcc != null )bcc = MailAddressCollection.Parse( message.Bcc );
- }
-
- // Properties
- public IList Attachments {
- get { return message.Attachments; }
- }
-
- public MailAddressCollection Bcc {
- get { return bcc; }
- }
-
- public string Body {
- get { return message.Body; }
- set { message.Body = value; }
- }
- public Encoding BodyEncoding {
- get { return message.BodyEncoding; }
- set { message.BodyEncoding = value; }
- }
- public MailFormat BodyFormat {
- get { return message.BodyFormat; }
- set { message.BodyFormat = value; }
- }
- public MailAddressCollection Cc {
- get { return cc; }
- }
- public MailAddress From {
- get { return from; }
- }
- public IDictionary Headers {
- get { return message.Headers; }
- }
-
- public MailPriority Priority {
- get { return message.Priority; }
- set { message.Priority = value; }
- }
-
- public string Subject {
- get { return message.Subject; }
- set { message.Subject = value; }
- }
- public MailAddressCollection To {
- get { return to; }
- }
- public string UrlContentBase {
- get { return message.UrlContentBase; }
-
- }
- public string UrlContentLocation {
- get { return message.UrlContentLocation; }
- }
- }
- }
|