| title | ms.custom | ms.date | ms.prod | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | f1_keywords | dev_langs | helpviewer_keywords | ms.assetid | caps.latest.revision | author | ms.author | manager | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<mailSettings> Element (Network Settings) |
03/30/2017 |
.net-framework |
|
article |
|
|
54f0f153-17e5-4f49-afdc-deadb940c9c1 |
20 |
mcleblanc |
markl |
markl |
<mailSettings> Element (Network Settings)
Configures mail sending options.
<configuration>
<system.net>
<mailSettings>
Syntax
<mailSettings
<smtp> … </smtp>
/mailsettings> Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes
None.
Child Elements
| Attribute | Description |
|---|---|
| <smtp> Element (Network Settings) | Configures Simple Mail Transport Protocol options. |
Parent Elements
| Element | Description |
|---|---|
| <system.Net> Element (Network Settings) | Contains settings that specify how the .NET Framework connects to the network. |
Example
The following example specifies the appropriate SMTP parameters to send e-mail using the default network credentials.
<configuration>
<system.net>
<mailSettings>
<smtp deliveryMethod="network">
<network
host="localhost"
port="25"
defaultCredentials="true"
/>
</smtp>
</mailSettings>
</system.net>
</configuration> See Also
xref:System.Net.Mail.SmtpClient
Network Settings Schema