Rails 3/Devise confirmation email server settings

你说的曾经没有我的故事 提交于 2019-12-05 21:59:12

问题


I have a Rails 3 app and I'm using Devise for user authentication. How do I specify an application-wide SMTP server for Devise to use?

I've entered the following into /config/environments/development.rb (Apache2 is set to 8080)

config.action_mailer.default_url_options = { :host => 'mydomain.com:8080' }

Any ideas on how to get outgoing mail to work with Devise and Rails 3?


回答1:


Devise uses ActionMailer to send emails so you have to configure it. Take a look at this tutorial for an example of setting up ActionMailer. Also if you are using GMail take a look at this question for details on setting up Rails 3 to use GMail.




回答2:


i was just watching episode 206 of the rail cast and seen the answer there ActionMailer::Base.default_url_options[:host] = 'mydomain.com:8080'



来源:https://stackoverflow.com/questions/4445258/rails-3-devise-confirmation-email-server-settings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!