Help us understand the problem. What is going on with this article?

Raspberry Pi2でgmailを送信

More than 3 years have passed since last update.

Raspberry Pi2でgmailを送信するための手順メモ
メールは、sSMTPを利用する。

用意したもの

  1. Raspberry Pi2(Raspbian 8.0)

インストール

ターミナル
$sudo apt-get install ssmtp

設定ファイルは、以下のように行う

/etc/ssmtp/ssmtp.conf
root=me@gmail.com

# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587

# Where will the mail seem to come from?
#rewriteDomain=

# The full hostname
hostname=raspberrypi

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES

AuthUser=me@gmail.com
AuthPass=password
UseSTARTTLS=YES

root, AuthUser, AuthPassは、各自の設定を記入

メール送信

テキスト編集

~/develop/mail/mail
From:me@gmail.com <- 何を指定しても関係ない
To:宛先のメールアドレス
Subject: Test-Subject

Test-Massage

メール送信

ターミナル
$sendmail -t < ~/develop/mail/mail
aryoa
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした