Action mailer SMTP google apps

后端 未结 2 2019
半阙折子戏
半阙折子戏 2021-01-12 12:59

I tried to configure actionmailer to send via google apps with smtp.

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:add         


        
相关标签:
2条回答
  • 2021-01-12 13:14

    It works now, I think the problem was with the username. it needs the domain in the username. i.e. the problem was

    user_name: 'username'
    

    Whereas the correct way (at least for google apps) is

    user_name : 'username@mydomain.com'
    
    0 讨论(0)
  • 2021-01-12 13:25

    this works for me:

    config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = {
    :address              => "smtp.gmail.com",
    :port                 => 587,
    :domain               => "gmail.com",
    :user_name            => "you@gmail.com",
    :password             => "password",
    :authentication       => 'plain',
    :enable_starttls_auto => true  }
    

    Try setting the domain to gmail.com

    0 讨论(0)
提交回复
热议问题