GMailのSMTPサーバをRedmineで使う » 履歴 » バージョン 1
Haru Iida, 2009/07/09 15:04
1 | 1 | Haru Iida | h1. GMailのSMTPサーバをRedmineで使う |
---|---|---|---|
2 | |||
3 | {{>toc}} |
||
4 | |||
5 | Redmineからメールを送信する際のSMTPサーバとしてGMailを利用する方法です。 |
||
6 | GMailは無料で利用できますし、Redmineが送ったメールの送信履歴を後からGMailにログインして確認できたりするので便利です。 |
||
7 | |||
8 | 元ネタはRedmine Official Blogです。本サイトでも利用しています。 |
||
9 | |||
10 | http://redmineblog.com/articles/setup-redmine-to-send-email-using-gmail |
||
11 | |||
12 | h2. action_mailer_optional_tls plugin をインストールする。 |
||
13 | |||
14 | GMailを使用してメールを送るためにはTLSで通信をする必要があります。しかしRuby 1.8ではTLSによるメール送信はサポートしていません。 |
||
15 | |||
16 | action_mailer_optional_tls_plugin を使うことによって RedmineからTLSでのメール送信が可能になります。 |
||
17 | |||
18 | このプラグインをインストールするにはRedmineのインストールフォルダにある script/plugin コマンドを使います。 |
||
19 | |||
20 | ruby script/plugin install git://github.com/collectiveidea/action_mailer_optional_tls.git |
||
21 | |||
22 | h2. email.ymlの設定 |
||
23 | |||
24 | config/email.yml をGMail用に編集します。 |
||
25 | |||
26 | <pre> |
||
27 | # File: config/email.yml |
||
28 | production: |
||
29 | delivery_method: :smtp |
||
30 | smtp_settings: |
||
31 | tls: true |
||
32 | address: "smtp.gmail.com" |
||
33 | port: '587' |
||
34 | domain: "smtp.gmail.com" |
||
35 | authentication: :plain |
||
36 | user_name: "your_email@gmail.com" |
||
37 | password: "your_password" |
||
38 | </pre> |
||
39 | |||
40 | tls: true |
||
41 | がポイントです。 |
||
42 | |||
43 | また、インデントにTABを使ったりすると上手く動きません。スペースを使ってください。 |
||
44 | |||
45 | h3. テスト |
||
46 | |||
47 | email.ymlの設定が終わったらテストしましょう。 |
||
48 | Redmineを再起動し、管理者アカウントでログインします。 |
||
49 | 管理メニュー->設定->メール通知 を開きます。 |
||
50 | |||
51 | 送信元メールアドレスにgmailのアドレスを設定し、「テストメールを送信」をクリックします。 |
||
52 | 一番上に「○○宛にメールを送信しました。」と出たら成功です。エラーになったら設定を見直してください。 |