<smtp> Element (Network Settings)
Configures the delivery method and from address for sending e-mails.
<configuration> Element
<system.net> Element (Network Settings)
<mailSettings> Element (Network Settings)
<smtp> Element (Network Settings)
<smtp
deliveryMethod="method"
from="from address"
<specifiedPickupDirectory> … </ specifiedPickupDirectory >
<network> … </network>
/smtp>
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes
Attribute |
Description |
---|---|
deliveryMethod |
Specifies the delivery method for e-mails. Acceptable values are network, pickupDirectoryFromIis, and specifiedPickupDirectory. |
from |
Specifies the from address for e-mails. |
Child Elements
Element |
Description |
---|---|
< specifiedPickupDirectory > |
Configures the local directory for a Simple Mail Transport Protocol (SMTP) server. |
Configures the network options for an external SMTP server. |
Parent Elements
Element |
Description |
---|---|
Configures mail sending options. |
Example
The following code example specifies the appropriate SMTP parameters to send e-mail using the default network credentials.
<configuration>
<system.net>
<mailSettings>
<smtp deliveryMethod="network" from="ben@contoso.com">
<network
host="localhost"
port="25"
defaultCredentials="true"
/>
</smtp>
</mailSettings>
</system.net>
</configuration>