MailMessage.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //
  2. // System.Web.Mail.MailMessage.cs
  3. //
  4. // Author:
  5. // Lawrence Pit ([email protected])
  6. // Per Arneng ([email protected])
  7. //
  8. using System;
  9. using System.Collections;
  10. using System.Collections.Specialized;
  11. using System.Text;
  12. namespace System.Web.Mail
  13. {
  14. /// <remarks>
  15. /// </remarks>
  16. public class MailMessage
  17. {
  18. private ArrayList attachments;
  19. private string bcc;
  20. private string body = "";
  21. private Encoding bodyEncoding;
  22. private MailFormat bodyFormat;
  23. private string cc;
  24. private string from;
  25. private ListDictionary headers;
  26. private MailPriority priority;
  27. private string subject = "";
  28. private string to;
  29. private string urlContentBase;
  30. private string urlContentLocation;
  31. private Hashtable fields;
  32. // Constructor
  33. public MailMessage ()
  34. {
  35. attachments = new ArrayList (8);
  36. headers = new ListDictionary ();
  37. bodyEncoding = Encoding.Default;
  38. fields = new Hashtable ();
  39. }
  40. // Properties
  41. public IList Attachments {
  42. get { return (IList) attachments; }
  43. }
  44. public string Bcc {
  45. get { return bcc; }
  46. set { bcc = value; }
  47. }
  48. public string Body {
  49. get { return body; }
  50. set { body = value; }
  51. }
  52. public Encoding BodyEncoding {
  53. get { return bodyEncoding; }
  54. set { bodyEncoding = value; }
  55. }
  56. public MailFormat BodyFormat {
  57. get { return bodyFormat; }
  58. set { bodyFormat = value; }
  59. }
  60. public string Cc {
  61. get { return cc; }
  62. set { cc = value; }
  63. }
  64. public string From {
  65. get { return from; }
  66. set { from = value; }
  67. }
  68. public IDictionary Headers {
  69. get { return (IDictionary) headers; }
  70. }
  71. public MailPriority Priority {
  72. get { return priority; }
  73. set { priority = value; }
  74. }
  75. public string Subject {
  76. get { return subject; }
  77. set { subject = value; }
  78. }
  79. public string To {
  80. get { return to; }
  81. set { to = value; }
  82. }
  83. public string UrlContentBase {
  84. get { return urlContentBase; }
  85. set { urlContentBase = value; }
  86. }
  87. public string UrlContentLocation {
  88. get { return urlContentLocation; }
  89. set { urlContentLocation = value; }
  90. }
  91. #if NET_1_1
  92. public IDictionary Fields {
  93. get {
  94. return (IDictionary) fields;
  95. }
  96. }
  97. #endif
  98. }
  99. } //namespace System.Web.Mail