LoginSignup
3
3

More than 3 years have passed since last update.

Gmail経由で、Macでメールを送る

Last updated at Posted at 2020-02-05

Macでメールが送りたい

とどけ!この想い!

前提

20202年2月5日

MacOS Mojave
10.14.06

postfixはインストールしておいてね。

設定ファイルの変更

設定ファイルの末尾に以下を入れる

/etc/postfix/main.cf
smtp_tls_security_level        = may
smtp_sasl_auth_enable          = yes
smtp_sasl_password_maps        = hash:/etc/postfix/sasl_passwd
smtp_sasl_mechanism_filter     = digest-md5 cram-md login plain
smtp_sasl_tls_security_options = noanonymous

Gmail、アプリで使用するパスワードを作成する

このGoogleアカウントのセキュリティページにアクセス

Google_アカウント.png

アプリのパスワードから、メールとMacを選択して生成を押す

アプリ_パスワード.png

アプリ_パスワード.png

上で出来たパスワードをメモるか、覚えてください

パスワードマップを作成

mymailaccount@gmail.com
は、自分のメールアドレスを入れてね。

xxxxpasswordは、Gmailのページで作成したパスワードを入れてね。
/etc/postfix/sasl_passwdを作成する

smtp.gmail.com:587      mymailaccount@gmail.com:xxxxpassword
sudo postmap /etc/postfix/sasl_passwd

権限などを設定する

sudo chmod 600 /etc/postfix/sasl_passwd

再起動

sudo postfix check
sudo postfix stop
sudo postfix start

メールの送信確認

echo test mail from Mac! | mail -s test myaccount@gmail.com

届いたかな!

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