<smtp> Element (Network Settings)
Configures the delivery format, delivery method, and from address for sending emails.
<configuration>
<system.net>
<mailSettings>
<smtp>
Syntax
<smtp
deliveryFormat="format"
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 |
---|---|
deliveryFormat |
Specifies the delivery format for outgoing emails. Acceptable values are SevenBit and International. |
deliveryMethod |
Specifies the delivery method for emails. Acceptable values are Network, PickupDirectoryFromIis, and SpecifiedPickupDirectory. |
from |
Specifies the from address for outgoing emails. |
Child Elements
Attribute | Description |
---|---|
specifiedPickupDirectory |
Configures the local directory for a Simple Mail Transport Protocol (SMTP) server. |
network |
Configures the network options for an external SMTP server. |
Parent Elements
Element | Description |
---|---|
<mailSettings> Element (Network Settings) | Configures mail sending options. |
Example
The following example specifies the appropriate SMTP parameters to send email using the default network credentials.
<configuration>
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" deliveryFormat="SevenBit" from="ben@contoso.com">
<network
host="localhost"
port="25"
defaultCredentials="true"
/>
</smtp>
</mailSettings>
</system.net>
</configuration>
See also
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.
الملاحظات
https://aka.ms/ContentUserFeedback.
قريبًا: خلال عام 2024، سنتخلص تدريجيًا من GitHub Issues بوصفها آلية إرسال ملاحظات للمحتوى ونستبدلها بنظام ملاحظات جديد. لمزيد من المعلومات، راجعإرسال الملاحظات وعرضها المتعلقة بـ