簡體   English   中英

mailchimp mailer不能在紅寶石的軌道上工作

[英]mailchimp mailer not working in ruby on rails

如果我在我的production.rb文件中將gmail和action mailer一起使用,我已經可以使用郵件了:

config.action_mailer.smtp_settings = {
    address: "smtp.gmail.com",
    port: 25,
    domain: "avidest.com",
    authentication: "plain",
    enable_starttls_auto: true,
    user_name: ENV['GOOGLEU'],
    password: ENV['GOOGLEP']
}

我正在嘗試使用如下電子郵件黑猩猩進行設置:

config.action_mailer.smtp_settings = {
    :address   => "smtp.mandrillapp.com",
    :port      => 25,
    :user_name => "david@dave23.com",
    :password  => ENV['MAILCHIMP_API_KEY']
}

由於某些原因,當我將其從gmail更改為黑猩猩時,該電子郵件無法發送。 我知道我的黑猩猩郵件帳戶可以正常運行,因為一段時間以來我一直在非橄欖球網站上使用它。

這是production.rb文件中的更多設置:

config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default :charset => "utf-8"
config.action_mailer.default_url_options = { :host => 'myappname.herokuapp.com' }

如何使黑猩猩在軌上與紅寶石一起工作?

以下是heroku日志:

2014-03-04T18:09:39.503235+00:00 app[web.1]: I, [2014-03-04T18:09:35.270759 #2]  INFO -- : Processing by Devise::RegistrationsController#create as HTML
2014-03-04T18:09:39.503235+00:00 app[web.1]: I, [2014-03-04T18:09:35.270956 #2]  INFO -- :   Parameters: {"utf8"=>"✓", "authenticity_token"=>"tT4VAL8zcsYCMINkp6WFN+OUO8c4lQQF5r8CtS2X43w=", "user"=>{"email"=>"pghrpg@gmail.com", "profile_name"=>"fsfadljkh", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "first_name"=>"phil", "last_name"=>"greenwald", "how_did_you_hear"=>"Google", "company"=>"", "title"=>"", "type"=>"Employer"}, "commit"=>"SIGN UP!"}
2014-03-04T18:09:39.503235+00:00 app[web.1]: I, [2014-03-04T18:09:36.407845 #2]  INFO -- :   Rendered devise/mailer/confirmation_instructions.html.erb (1.6ms)
2014-03-04T18:09:39.503235+00:00 app[web.1]: I, [2014-03-04T18:09:39.132870 #2]  INFO -- : 
2014-03-04T18:09:39.503235+00:00 app[web.1]: Sent mail to pghrpg@gmail.com (2722.0ms)
2014-03-04T18:09:39.503235+00:00 app[web.1]: I, [2014-03-04T18:09:39.145575 #2]  INFO -- :      Redirected to http://nameless-escarpment-1084.herokuapp.com/
2014-03-04T18:09:39.503601+00:00 app[web.1]: I, [2014-03-04T18:09:39.145918 #2]  INFO -- : Completed 302 Found in 3875ms (ActiveRecord: 150.2ms)

我做了一些修補,並且在我的heroku日志中看到了這一點:

Net::SMTPAuthenticationError (435 4.7.8 Error: authentication failed):

我正在使用Mailchimp,這適用於我的。

config.action_mailer.smtp_settings = {
  :address   => "smtp.mandrillapp.com",
  :port      => 587, # ports 587 and 2525 are also supported with STARTTLS
  :enable_starttls_auto => true, # detects and uses STARTTLS
  :user_name => "yourmandrillappnumber@heroku.com",
  :password  => "your_SMTP_password", # SMTP password is any valid API key
  :authentication => 'login', # Mandrill supports 'plain' or 'login'
  :domain => 'example.com', # your domain to identify your server when connecting
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM