LoginSignup
9
9

More than 5 years have passed since last update.

SMTP コマンドを自分で打ってメールを送信する

Posted at

Overview

なんでもいいからテストメール投げるとか、環境の確認とか接続テストとか。
たまに必要となる時があるけど、たまにしか必要にならないので覚えられない SMTP コマンドの叩き方のおぼえがき。

How To

xxx の部分は何らかのメッセージが出るところです。環境によって違います。説明文やドメイン名を表示する環境もあれば、250 ok みたいに一言しか返さないサーバもあります。
本当におぼえがきなので、解説はなしです。

$ telnet smtp.example.com 25
xxx (複数行)
220 xxx
HELO localhost
250 xxx
MAIL FROM:test@example.com
250 xxx
RCPT TO:test@example.com
250 xxx
DATA
354 xxx
Subject: Test
From: test@example.com
To: test@example.com

Test message...
.

250 xxx
QUIT
221 XXX
9
9
1

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