Ruby On Rails: настройка actionmailer
Материал из 1GbWiki.
(Различия между версиями)
Версия 13:06, 20 ноября 2009 (править) Dmih (Обсуждение | вклад) м ← К предыдущему изменению |
Текущая версия (22:09, 15 марта 2018) (править) (отменить) Renton (Обсуждение | вклад) |
||
Строка 3: | Строка 3: | ||
Rails::Initializer.run do |config| | Rails::Initializer.run do |config| | ||
config.action_mailer.smtp_settings = { | config.action_mailer.smtp_settings = { | ||
- | :address => ' | + | :address => 'robots.1gb.ru', |
:port=>25, | :port=>25, | ||
- | :domain => 'sitedomain.ru' | + | :domain => 'sitedomain.ru' |
- | + | ||
- | + | ||
- | + | ||
} | } | ||
config.action_mailer.delivery_method = :smtp | config.action_mailer.delivery_method = :smtp |
Текущая версия
Для настройки gem actionmailer Вам потребуется указать следующие параметры в файле environemnts.rb:
Rails::Initializer.run do |config| config.action_mailer.smtp_settings = { :address => 'robots.1gb.ru', :port=>25, :domain => 'sitedomain.ru' } config.action_mailer.delivery_method = :smtp config.action_mailer.raise_delivery_errors = true config.action_mailer.perform_deliveries = true config.action_mailer.default_charset = 'utf-8' end
При инициализации настроек внутри блока Rails::Initializer.run do необходимо обращение к config.action_mailer.smtp_settings, но можно выполнять инициализацию в этом же файле и вне блока простым обращением к ActionMailer:Base.smtp_settings