全栈学习42天 mailgun

Objective

1.mailgun dns设置

2.godaddy dns设置

3.config/environments
development.rb 修改,前两行注释掉,前两行是在本地啦作用

#config.action_mailer.default_url_options = {host: 'localhost:3000'}
  #config.action_mailer.delivery_method = :letter_opener

  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    :port           => ENV['MAILGUN_SMTP_PORT'],
    :address        => ENV['MAILGUN_SMTP_SERVER'],
    :user_name      => ENV['MAILGUN_SMTP_LOGIN'],
    :password       => ENV['MAILGUN_SMTP_PASSWORD'],
    :domain         => 'qinfeng.io', #eg: 'yourappname.herokuapp.com'
    :authentication => :plain,
  }

Comments

comments powered by Disqus