Rails 关于 mailer

menghuanwd · October 13, 2012 · Last by RanX12 replied at November 14, 2019 · 2889 hits

用 Action Mailer 来做个一个 rails 的发邮箱功能,教程中:

ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com",
:port => 587, :domain => "railscasts.com",
:user_name => "railscasts",
:password => "secret", :authentication => "plain", :enable_starttls_auto => true }

这些是什么意思啊,如果中自己的 Gmail 邮箱的话,以上要改哪些?

domain user_name password

#3 楼 @menghuanwd 就是你网站的域名

config.action_mailer.smtp_settings = {
  :address              => "smtp.gmail.com",
  :port                 => 587,
  :domain               => 'www.google.com',
  :user_name            => '[email protected]',
  :password             => 'google',
  :authentication       => 'plain',
  :enable_starttls_auto => true  }

这个模版。

You need to Sign in before reply, if you don't have an account, please Sign up first.