LoginSignup
14
18

More than 5 years have passed since last update.

Ubuntu 環境で sSMTP を利用して Gmail を送信してみる

Last updated at Posted at 2015-07-14

Ubuntu 環境で sSMTP を利用して Gmail を送信してみる

手順

インストール


sudo apt-get install ssmtp

認証設定


sudo vi /etc/ssmtp/ssmtp.conf

# 下記追記 or 変更
root=hoge@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=gmail.com
hostname=gmail.com
AuthUser=hoge@gmail.com
AuthPass=password
AuthMethod=LOGIN
UseSTARTTLS=YES
FromLineOverride=YES

テストメール送信

以下の内容のファイルを作成

test-mail

To:hoge@gmail.com
From:hoge@gmail.com
Subject:test-mail

test-mail

送信


sudo /usr/sbin/sendmail -t < test-mail

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