LoginSignup
14
14

More than 5 years have passed since last update.

Windows Server 2016でIISのSMTPサーバを立ててメール送信する

Last updated at Posted at 2018-11-27

インストールと設定

  • サーバーマネージャでIISのSMTPをインストールする
    • Webサーバもインストールされる
  • IIS6.0マネージャを起動する
  • ツリーを展開して[SMTP Virtual Server #1]を右クリックしてプロパティを開く

image.png

  • アクセスタブ->中継をクリック

image.png

  • メール送信を受け付ける(許可する)コンピュータのIPアドレスや、セグメント、ドメインなどを指定する

image.png

  • デフォルトでは匿名アクセスとなっているので、認証なしにメールを送信できる

メール送信テスト

  • ここではLinuxサーバで試す
  • telnetでSMTPサーバにつなげて以下のように応答に入力してく
    • 件名と本文は未入力
    • data(本文)の入力後、ドットで本文を終了し、quitでメールを送信する
telnet smtpserver01.contoso.com 25
helo smtpserver01.contoso.com
mail from: user01@contoso.com
rcpt to: user99@example.com
data
.
quit
  • 標準出力は以下のようになる
[root@linuxserver01 ~]# telnet smtpserver01.contoso.com 25
Trying 10.0.1.2...
Connected to smtpserver01.contoso.com.
Escape character is '^]'.
220 smtpserver01 Microsoft ESMTP MAIL Service, Version: 10.0.14393.0 ready at  Tue, 27 Nov 2018 11:03:33 +0900
helo smtpserver01.contoso.com
250 smtpserver01 Hello [10.0.1.2]
mail from: user01@contoso.com
250 2.1.0 user01@contoso.com....Sender OK
rcpt to: user99@example.com
250 2.1.5 user99@example.com
data
354 Start mail input; end with <CRLF>.<CRLF>
.
250 2.6.0 <SMTPSERVER01nHM3SOl00000006@smtpserver01> Queued mail for delivery
quit
221 2.0.0 smtpserver01 Service closing transmission channel
Connection closed by foreign host.
  • メールボックスにメールが届いたか確認する
  • おしまい
14
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
14