2016-07-03 59 views
0

在我的終端工作,充分顯示了它的工作,但我沒有收到我的Gmail郵箱的實際電子郵件。我跟着這https://youtu.be/YnGuALpJN1M,但無法弄清楚是什麼問題。它也不會在sendgrid網站上顯示任何活動。Ruby on Rails的:Sendgrid未檢索的電子郵件信箱,在終端

我試圖在開發測試sendgrid:

development.rb

Rails.application.configure do 
    config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } 
    config.action_mailer.delivery_method = :smtp 
    config.action_mailer.perform_deliveries = true 

    # more codes 

end 

配置/ sedngrid_secrets.yml

development: 
    SENDGRID_USERNAME: [email protected] 
    SENDGRID_PASSWORD: something 

到config/environment.rb

ActionMailer::Base.smtp_settings = { 
    address: 'smtp.sendgrid.net', 
    port: '587', 
    authentication: :plain, 
    user_name: ENV['SENDGRID_USERNAME'], 
    password: ENV['SENDGRID_PASSWORD'], 
    domain: 'heroku.com', 
    enable_starttls_auto: true 
} 

我在做什麼錯在這裏?

回答

1

試試這個在您的development.rb文件。然後取出動作郵件從你的config/environment.rb中設置

config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } 

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

     address: 'smtp.sendgrid.net', 
     port: '587', 
     authentication: :plain, 
     user_name: ENV['SENDGRID_USERNAME'], 
     password: ENV['SENDGRID_PASSWORD'], 
     domain: 'heroku.com', 
     enable_starttls_auto: true 

    } 
相關問題