<smtp> 요소(네트워크 설정)

메일 전송을 위한 배달 형식, 배달 방법, 보낸 사람 주소를 구성합니다.

<configuration>
  <system.net>
    <mailSettings>
      <smtp>

구문

<smtp  
  deliveryFormat="format"  
  deliveryMethod="method"  
  from="from address">
    <specifiedPickupDirectory>...</specifiedPickupDirectory>  
    <network>...</network>  
</smtp>  

특성 및 요소

다음 섹션에서는 특성, 자식 요소 및 부모 요소에 대해 설명합니다.

특성

특성 Description
deliveryFormat 보낼 메일의 배달 형식을 지정합니다. 허용 가능한 값은 SevenBit와 International입니다.
deliveryMethod 메일의 배달 방법을 지정합니다. 허용되는 값은 Network, PickupDirectoryFromIis, SpecifiedPickupDirectory입니다.
from 보낼 메일의 보낸 사람 주소를 지정합니다.

자식 요소

attribute Description
specifiedPickupDirectory SMTP(Simple Mail Transport Protocol) 서버에 대한 로컬 디렉터리를 구성합니다.
network 외부 SMTP 서버에 대한 네트워크 옵션을 구성합니다.

부모 요소

요소 설명
<mailSettings> 요소(네트워크 설정) 메일 전송 옵션을 구성합니다.

예제

다음 예에서는 기본 네트워크 자격 증명을 사용하여 이메일을 보내기 위한 적절한 SMTP 매개 변수를 지정합니다.

<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>  

참고 항목