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