簡體   English   中英

Rails 4-在本地發送郵件不起作用

[英]rails 4 - sending mail locally not working

我正在使用發送確認電子郵件的設備。 我不確定它在做什么,但是我可以在“ rails s”的輸出中看到該郵件已發送到正確的電子郵件中。

config / environments / development.rb:

config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp 
config.action_mailer.smtp_settings = {
  address: 'smtp.gmail.com',
  port: 587,
  domain: 'localhost:3000',
  username: 'email@gmail.com',
  password: 'pwd',
  authentication: 'plain',
  enable_starttls_auto: true
}

我已經看到了很多stackoverflow問題,但是所有內容僅顯示此配置,這對我來說不起作用。

它的用戶名,但不是用戶名。 觀察下划線。

另請注意,domain是“可選”的,因此您可以將其刪除。

並且,設置此值(默認情況下為false):

config.action_mailer.raise_delivery_errors = true

如果您想查看送貨錯誤

暫無
暫無

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

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