简体   繁体   English

ActionMailer不在本地环境中发送电子邮件

[英]ActionMailer not sending emails in local environment

I've configured my gmail variables in order to send test mails from my app: 我已经配置了gmail变量,以便从我的应用发送测试邮件:

application.rb application.rb中

ActionMailer::Base.smtp_settings = {
  :address        => 'smtp.gmail.com',
  :domain         => 'mail.google.com',
  :port           => 587,
  :user_name      => 'enriqueisasi@gmail.com',
  :password       => 'mypass',
  :authentication => :plain,
  :enable_starttls_auto => true
}

I can see in my logs its working, but I still don't see the emails in my Gmail: 我可以在日志中看到它的运行情况,但仍然看不到Gmail中的电子邮件:

Logs 日志

Sent mail to enriqueisasi@gmail.com (219.7ms)
Date: Mon, 05 Sep 2016 01:32:55 +0200
From: Your Mailer <hola@benditapizza.es>
To: Me <enriqueisasi@gmail.com>
Message-ID: <57ccaf2742bc0_3d03ff35f488dec6265@MacBook-Pro-de-Enrique-2.local.mail>
Subject: Mensaje de adfadf
Mime-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

I guess that you missed setting this config in development.rb 我想你错过了在development.rb设置此配置

config.action_mailer.perform_deliveries = true

as by default this is on false, preventing mails to be sent from your development environment 默认情况下,此选项为false,以防止从您的开发环境发送邮件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM