SmtpMail.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <Type Name="SmtpMail" FullName="System.Web.Mail.SmtpMail">
  2. <TypeSignature Language="C#" Value="public class SmtpMail" Maintainer="auto" />
  3. <AssemblyInfo>
  4. <AssemblyName>System.Web</AssemblyName>
  5. <AssemblyPublicKey>
  6. </AssemblyPublicKey>
  7. <AssemblyVersion>1.0.5000.0</AssemblyVersion>
  8. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  9. </AssemblyInfo>
  10. <ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the &lt;link location="node:gtk-sharp/programming/threads"&gt;Gtk# Thread Programming&lt;/link&gt; for details.</ThreadSafetyStatement>
  11. <Base>
  12. <BaseTypeName>System.Object</BaseTypeName>
  13. </Base>
  14. <Interfaces />
  15. <Docs>
  16. <summary>This class is used for sending e-mails over the SMTP protocol.</summary>
  17. <remarks>
  18. <para>
  19. This class provides methods for sending e-mails over the SMTP protocol. It exposes this
  20. functionallity through the <see cref="M:System.Web.Mail.SmtpMail.Send(string,string,string,string)" /> and
  21. <see cref="M:System.Web.Mail.SmtpMail.Send(MailMessage)" /> methods. The e-mail is sent over the
  22. SMTP protocol using an SMTP server which address is defined in <see cref="P:System.Web.Mail.SmtpMail.SmtpServer" />.
  23. </para>
  24. <para>
  25. This example shows the typical usage of the SmtpMail class. To run this sample you have to change the
  26. e-mail addresses and the SMTP server to real ones.
  27. <example><code lang="C#">
  28. using System;
  29. using System.Web.Mail;
  30. public class SmtpTest {
  31. public static void Main (String[] args)
  32. {
  33. MailMessage message = new MailMessage();
  34. message.From = "[email protected]";
  35. message.To = "[email protected]";
  36. message.Subject = "Hello, E-Mail world!";
  37. message.Body = "This is a test mail.";
  38. SmtpMail.SmtpServer = "mail.foo.bar";
  39. SmtpMail.Send (message);
  40. }
  41. }
  42. </code></example></para>
  43. </remarks>
  44. </Docs>
  45. <Members>
  46. <Member MemberName="Send">
  47. <MemberSignature Language="C#" Value="public static void Send (System.Web.Mail.MailMessage message);" />
  48. <MemberType>Method</MemberType>
  49. <ReturnValue>
  50. <ReturnType>System.Void</ReturnType>
  51. </ReturnValue>
  52. <Parameters>
  53. <Parameter Name="message" Type="System.Web.Mail.MailMessage" />
  54. </Parameters>
  55. <Docs>
  56. <param name="message">The message to be sent by the <c>Send</c> method.</param>
  57. <summary>Sends a MailMessage which represents an e-mail over the SMTP protocol.</summary>
  58. <remarks>
  59. <para>
  60. This method sends an e-mail to the recipients specified in the <see cref="T:System.Web.Mail.MailMessage" /> parameter
  61. <paramref name="message" />. The e-mail is sent over the SMTP protocol through the server
  62. specified in <see cref="P:System.Web.Mail.SmtpMail.SmtpServer" />.
  63. </para>
  64. <para>
  65. This example shows the typical usage of the <c>SmtpMail.Send</c> method. To run this sample you have to change the
  66. e-mail addresses and the SMTP server to real ones.
  67. <example><code lang="C#">
  68. using System;
  69. using System.Web.Mail;
  70. public class SmtpTest {
  71. public static void Main (String[] args)
  72. {
  73. MailMessage message = new MailMessage();
  74. message.From = "[email protected]";
  75. message.To = "[email protected]";
  76. message.Subject = "Hello, E-Mail world!";
  77. message.Body = "This is a test mail.";
  78. SmtpMail.SmtpServer = "mail.foo.bar";
  79. SmtpMail.Send (message);
  80. }
  81. }
  82. </code></example></para>
  83. </remarks>
  84. </Docs>
  85. <AssemblyInfo>
  86. <AssemblyVersion>1.0.5000.0</AssemblyVersion>
  87. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  88. </AssemblyInfo>
  89. </Member>
  90. <Member MemberName="Send">
  91. <MemberSignature Language="C#" Value="public static void Send (string from, string to, string subject, string messageText);" />
  92. <MemberType>Method</MemberType>
  93. <ReturnValue>
  94. <ReturnType>System.Void</ReturnType>
  95. </ReturnValue>
  96. <Parameters>
  97. <Parameter Name="from" Type="System.String" />
  98. <Parameter Name="to" Type="System.String" />
  99. <Parameter Name="subject" Type="System.String" />
  100. <Parameter Name="messageText" Type="System.String" />
  101. </Parameters>
  102. <Docs>
  103. <param name="from">The sender of the e-mail. This will be shown in the From field of the e-mail.</param>
  104. <param name="to">The reciever of the e-mail. This will be shown in the To field of the e-mail</param>
  105. <param name="subject">The subject of the e-mail.</param>
  106. <param name="messageText">The body of the e-mail.</param>
  107. <summary>A method that sends e-mail messages.</summary>
  108. <remarks>
  109. <para>
  110. This is a method that sends an e-mail message over the SMTP protocol. It connects
  111. to the SMTP server as specified in <see cref="P:System.Web.Mail.SmtpMail.SmtpServer" /> and
  112. sends the e-mail to <paramref name="to" />. This method is a simplified version of
  113. <see cref="M:System.Web.Mail.SmtpMail.Send(MailMessage)" /> which is actually used by this
  114. method for sending e-mails.
  115. </para>
  116. <para>
  117. Here is a simple example to show how to send an e-mail.
  118. <example><code lang="C#">
  119. using System;
  120. using System.Web.Mail;
  121. public class SmtpTest {
  122. public static void Main (String[] args)
  123. {
  124. SmtpMail.SmtpServer = "mail.foo.bar";
  125. SmtpMail.Send ("[email protected]","[email protected]","Hello, E-Mail world!","This is a test mail.");
  126. }
  127. }
  128. </code></example></para>
  129. </remarks>
  130. </Docs>
  131. <AssemblyInfo>
  132. <AssemblyVersion>1.0.5000.0</AssemblyVersion>
  133. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  134. </AssemblyInfo>
  135. </Member>
  136. <Member MemberName="SmtpServer">
  137. <MemberSignature Language="C#" Value="public static string SmtpServer { set; get; }" />
  138. <MemberType>Property</MemberType>
  139. <ReturnValue>
  140. <ReturnType>System.String</ReturnType>
  141. </ReturnValue>
  142. <Parameters />
  143. <Docs>
  144. <summary>This property tells the <c>Send</c> methods which SMTP server they should use.</summary>
  145. <value>A string representing the SMTP server address that the e-mails should be sent through.</value>
  146. <remarks>
  147. <para>
  148. This property represents the address of the SMTP server that the <c>Send</c> methods should use
  149. when sending e-mail messages. I the address is not set then the <c>Send</c> methods will try
  150. to connect to the local machine and check if there is an SMTP server running there.
  151. </para>
  152. </remarks>
  153. </Docs>
  154. <AssemblyInfo>
  155. <AssemblyVersion>1.0.5000.0</AssemblyVersion>
  156. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  157. </AssemblyInfo>
  158. </Member>
  159. </Members>
  160. <Attributes>
  161. <Attribute>
  162. <AttributeName>System.Obsolete("The recommended alternative is System.Net.Mail.SmtpClient.")</AttributeName>
  163. </Attribute>
  164. </Attributes>
  165. </Type>