1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

EC2でgmailにメール送ってみた

Last updated at Posted at 2022-07-31

参考
https://www.sambaiz.net/article/313/
https://codeforfun.jp/how-to-send-email-with-postfix-and-gmail/
2つ目のリンクの方法で検証成功した後に1つ目のリンクの方法を検証

1つ目のリンク参照

echo -ne '\0めあど\0あぷりぱすわーど' | base64
#出力結果コピー
openssl s_client -connect smtp.gmail.com:465 -crlf -ign_eof


---
220 smtp.gmail.com ESMTP u7-20020a170902e80700b0016ed5266a5csm2145168plg.170 - gsmtp
HELO ip-10-0-2-159.ap-northeast-1.compute.internal
250 smtp.gmail.com at your service
AUTH PLAIN  さっきの出力されたbase64
235 2.7.0 Accepted
MAIL FROM: <送信先めあど>
250 2.1.0 OK u7-20020a170902e80700b0016ed5266a5csm2145168plg.170 - gsmtp
RCPT TO:  <送信先めあど>
250 2.1.5 OK u7-20020a170902e80700b0016ed5266a5csm2145168plg.170 - gsmtp
DATA
354  Go ahead u7-20020a170902e80700b0016ed5266a5csm2145168plg.170 - gsmtp
Subject: testmail

this mail is test
.
250 2.0.0 OK  1659249924 u7-20020a170902e80700b0016ed5266a5csm2145168plg.170 - gsmtp

quit
221 2.0.0 closing connection u7-20020a170902e80700b0016ed5266a5csm2145168plg.170 - gsmtp
read:errno=0

いけた
image.png

RCPTに関してはgmail側で上書きされます

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?