-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
SmtpMail.xml
185 lines (165 loc) · 11.4 KB
/
SmtpMail.xml
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
175
176
177
178
179
180
181
182
183
184
185
<Type Name="SmtpMail" FullName="System.Web.Mail.SmtpMail">
<TypeSignature Language="C#" Value="public class SmtpMail" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit SmtpMail extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.Web.Mail.SmtpMail" />
<TypeSignature Language="VB.NET" Value="Public Class SmtpMail" />
<TypeSignature Language="F#" Value="type SmtpMail = class" />
<TypeSignature Language="C++ CLI" Value="public ref class SmtpMail" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Obsolete("The recommended alternative is System.Net.Mail.SmtpClient. http://go.microsoft.com/fwlink/?linkid=14202")]</AttributeName>
<AttributeName Language="F#">[<System.Obsolete("The recommended alternative is System.Net.Mail.SmtpClient. http://go.microsoft.com/fwlink/?linkid=14202")>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Provides properties and methods for sending messages using the Collaboration Data Objects for Windows 2000 (CDOSYS) message component. Recommended alternative: <see cref="N:System.Net.Mail" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The mail message can be delivered either through the SMTP mail service built into Microsoft Windows 2000 or through an arbitrary SMTP server. Types in the <xref:System.Web.Mail> namespace can be used from ASP.NET or from any managed application.
If the <xref:System.Web.Mail.SmtpMail.SmtpServer%2A> property is not set, mail is by default queued on a Windows 2000 system, ensuring that the calling program does not block network traffic. If the <xref:System.Web.Mail.SmtpMail> property is set, the mail is delivered directly to the specified server.
## Examples
The following example can be compiled to a console application that is used to send email from a command line. If you compile the example to a file named MailMessage.exe, use the executable file to send email as follows:
```
MailMessage to@contoso.com from@contoso.com test hello
```
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Mail.SmtpMail/CS/systemwebmailsmtpmail.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Mail.SmtpMail/VB/systemwebmailsmtpmail.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
<Members>
<MemberGroup MemberName="Send">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Sends an email message. Recommended alternative: <see cref="N:System.Net.Mail" />.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Send">
<MemberSignature Language="C#" Value="public static void Send (System.Web.Mail.MailMessage message);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Send(class System.Web.Mail.MailMessage message) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Mail.SmtpMail.Send(System.Web.Mail.MailMessage)" />
<MemberSignature Language="VB.NET" Value="Public Shared Sub Send (message As MailMessage)" />
<MemberSignature Language="F#" Value="static member Send : System.Web.Mail.MailMessage -> unit" Usage="System.Web.Mail.SmtpMail.Send message" />
<MemberSignature Language="C++ CLI" Value="public:
 static void Send(System::Web::Mail::MailMessage ^ message);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="message" Type="System.Web.Mail.MailMessage" />
</Parameters>
<Docs>
<param name="message">The <see cref="T:System.Web.Mail.MailMessage" /> to send.</param>
<summary>Sends an email message using arguments supplied in the properties of the <see cref="T:System.Web.Mail.MailMessage" /> class. Recommended alternative: <see cref="N:System.Net.Mail" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use <xref:System.Web.Mail.MailMessage> to send an email message using <xref:System.Web.Mail.SmtpMail>.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic SmtpMail.Send Example/CS/smtpmailsend.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic SmtpMail.Send Example/VB/smtpmailsend.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.Runtime.InteropServices.COMException">The mail cannot be sent.</exception>
<exception cref="T:System.PlatformNotSupportedException">The <see cref="M:System.Web.Mail.SmtpMail.Send(System.Web.Mail.MailMessage)" /> method requires the Microsoft Windows NT, Windows 2000, or Windows XP operating system.</exception>
</Docs>
</Member>
<Member MemberName="Send">
<MemberSignature Language="C#" Value="public static void Send (string from, string to, string subject, string messageText);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Send(string from, string to, string subject, string messageText) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Mail.SmtpMail.Send(System.String,System.String,System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Shared Sub Send (from As String, to As String, subject As String, messageText As String)" />
<MemberSignature Language="F#" Value="static member Send : string * string * string * string -> unit" Usage="System.Web.Mail.SmtpMail.Send (from, to, subject, messageText)" />
<MemberSignature Language="C++ CLI" Value="public:
 static void Send(System::String ^ from, System::String ^ to, System::String ^ subject, System::String ^ messageText);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<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 address of the email sender.</param>
<param name="to">The address of the email recipient.</param>
<param name="subject">The subject line of the email message.</param>
<param name="messageText">The body of the email message.</param>
<summary>Sends an email message using the specified destination parameters. Recommended alternative: <see cref="N:System.Net.Mail" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to send a simple message using <xref:System.Web.Mail.SmtpMail>.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic SmtpMail.Send Example/CS/smtpmailsend.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic SmtpMail.Send Example/VB/smtpmailsend.vb" id="Snippet2":::
]]></format>
</remarks>
<exception cref="T:System.PlatformNotSupportedException">The <see cref="M:System.Web.Mail.SmtpMail.Send(System.String,System.String,System.String,System.String)" /> method requires the Microsoft Windows NT, Windows 2000, or Windows XP operating system.</exception>
</Docs>
</Member>
<Member MemberName="SmtpServer">
<MemberSignature Language="C#" Value="public static string SmtpServer { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property string SmtpServer" />
<MemberSignature Language="DocId" Value="P:System.Web.Mail.SmtpMail.SmtpServer" />
<MemberSignature Language="VB.NET" Value="Public Shared Property SmtpServer As String" />
<MemberSignature Language="F#" Value="static member SmtpServer : string with get, set" Usage="System.Web.Mail.SmtpMail.SmtpServer" />
<MemberSignature Language="C++ CLI" Value="public:
 static property System::String ^ SmtpServer { System::String ^ get(); void set(System::String ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the name of the SMTP relay mail server to use to send email messages. Recommended alternative: <see cref="N:System.Net.Mail" />.</summary>
<value>The name of the email relay server.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If your local SMTP server (included with Windows 2000 and Windows Server 2003) is behind a firewall that blocks any direct SMTP traffic (through port 25), you will need to find out if there is a smart host available on your network that is allowed to relay SMTP messages to the Internet.
A smart host is an SMTP server with the permissions to relay outgoing email messages directly to the Internet from internal SMTP servers. A smart host should be able to simultaneously connect to both the internal network and the Internet in order to work as the email gateway.
## Examples
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Mail.SmtpMail.SmtpServer/CS/systemwebmailsmtpmailsmtpserver.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Mail.SmtpMail.SmtpServer/VB/systemwebmailsmtpmailsmtpserver.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>