successfully installed action_mailer_optional_tls to send using GMail?

旧时模样 提交于 2019-12-24 08:38:01

问题


I installed action_mailer_optional_tls for Rails 2.3.2 and Ruby 1.8.6 and I cannot get ActionMailer to send email!

I get the following error:

530 5.7.0 Must issue a STARTTLS command first

Sadness...anyone had success?


回答1:


What is in your environment.rb file to configure the tls settings? This is what I'm using:

config.action_mailer.smtp_settings = { 
  :tls => true,
  :address => "smtp.gmail.com",
  :port => "587",
  :domain => "mydomain.com", 
  :user_name => "user@mydomain.com", 
  :password => "mypassword", 
  :authentication => :login
}

I've had no problems using that gem in my application running under rails 2.3.2




回答2:


I have a similar problem with Rails 2.3.2 and Ruby 1.8.6. The new version of Rails uses part of Ruby 1.8.7 for TLS support. I found out more at this blog post. Basically if you have Ruby 1.8.6 you will need to install and configure the ActionMailerTLS gem, you can find it on github. My problems cleared up once I did that.



来源:https://stackoverflow.com/questions/801005/successfully-installed-action-mailer-optional-tls-to-send-using-gmail

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