RAILS PRESS RUBY on RAILS, it’s DRY and COOL …

RSS Feed

RAILS PRESS RSS

Tag Cloud

はてなブックマーク - railspress.matake.jp の注目エントリー
象形文字くさび形文字ミイラそろばんの玉そろばんコーラン占いの板?象牙大英博物館
Tagged by ActionMailer

Posted on
2008/05/01

Tags
ActionMailer, Rails2.0, インストール/設定

0 Comment

この記事をはてなブックマークに登録 この記事のはてなブックマーク数 この記事を livedoor クリップに登録この記事の livedoor クリップ数 このエントリを del.icio.us に追加
ブックマークに追加する

Rails2.0ではActionMailer::Base.server_settingsは使えない

いままでActionMailerでSMTP/SendMailを使う場合は、「ヽ( ・∀・)ノくまくまー」さんのActionMailer::Base.server_settingsの書き方を参考にしていたのですが、Rails2.0になってからはserver_settingsというメソッドが廃止されたようです。

代わりに以下のように、smtp_settings or sendmail_settingsを使います。

例)SMTP Settings

LANG : RUBY
  1. ActionMailer::Base.delivery_method = :smtp
  2. ActionMailer::Base.smtp_settings = {
  3.         :address                => "smtp.mymailserver.com",
  4.         :authentication        => :login,
  5.         :user_name                => "me",
  6.         :password                => "password"
  7. }

例)SendMail Settings

LANG : RUBY
  1. ActionMailer::Base.delivery_method = :sendmail
  2. ActionMailer::Base.sendmail_settings = {
  3.   :location       => '/usr/sbin/sendmail',
  4.   :arguments      => '-i -t'
  5. }

» このエントリーには続きがあります。続きを読む »


ActionMailerタグ