- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试设置我的 rails 4 应用程序,以便它发送电子邮件。有谁知道我为什么会得到:
Net::SMTPAuthenticationError
534-5.7.9 Application-specific password required.
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
# config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
# Gmail SMTP server setup
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:domain => "mail.google.com",
:port => 587,
:authentication => :plain,
:user_name => "myrealaddress@gmail.com",
:password => "myrealpassword",
:enable_starttls_auto => true
}
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config.assets.raise_runtime_errors = true
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
# false prevents mail from being sent in development environment
config.action_mailer.perform_deliveries = true
end
class Share < ActionMailer::Base
default_url_options[:host] = "localhost:3000"
default from: "myrealaddress@gmail.com"
def profile(profile, destination)
@profile = profile
mail(to: destination, subject: "sent you stuff")
end
end
最佳答案
该错误是因为您的帐户启用了双因素身份验证。要使用启用了双因素身份验证的 gmail 帐户,您需要做的就是生成一个新的应用程序密码以用于您的邮件程序配置。
可以在此处生成 gmail 的新应用密码 - https://security.google.com/settings/security/apppasswords .
生成新密码时选择 Mail
为 Select App
设置和 Other(Custom name)
为 Select Device
环境。
获得新密码后,使用 Google 为您生成的随机字符串更新您的邮件程序配置,您应该已设置好。
关于email - 网络::SMTPAuthenticationError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25597507/
我有一个 postfix 电子邮件服务器,有一个问题我想调试。 我如何配置它以将每封电子邮件的副本发送到我的电子邮件(除了将电子邮件发送给其预期收件人)。 最佳答案 我最近开始工作了,所以尽管我会分享
我的 Web 应用程序发送电子邮件的频率相当高,它发送 3 种电子邮件:由用户发起、响应系统中的事件以及自动响应应用程序收到的电子邮件。 我想确保第三种类型的电子邮件不会陷入自动回复器相互交谈的无限循
我家里有一台电脑,但我无法在工作中使用它。我希望能够查看我的家用计算机生成的工作结果。我想出的最好的主意是在我的家用计算机上运行一个自动脚本,它在完成后通过电子邮件将结果(来自文本文件或 stderr
我在 Google App Engine 上编写了一个应用程序,可以将电子邮件发送到一个地址。应用程序在测试期间达到了它的“通过电子邮件发送的收件人”配额限制。对于“已发送电子邮件的收件人”配额,是否
我的代码循环发送多封带附件的电子邮件, 问题是最后(之前的所有)电子邮件的附件附加到下一封电子邮件。 例如。假设数据库中有 3 封电子邮件,每封邮件有 1 个附件(a1.pdf、a2.pdf、a3.p
我的应用程序使用电子邮件通知我重要事件。它通过将电子邮件发送到我的电子邮件地址(标记为应用程序的所有者)来这样做(使用 Python 运行时)。 免费层允许每天向收件人发送 100 封电子邮件,但向管
我们在 VPS 上使用 exim。我们在 WP 和 Magento 上托管多个域。 最近,当我在 Received 标题中看到以下内容时,我正在查看一些电子邮件:我的 linux 用户名、服务器名(不
官方格式是什么 name 在电子邮件标题中?我需要先验证用户输入,然后再将其粘贴到标题中。 另外,您是否碰巧知道好的正则表达式来验证名称+电子邮件对的形式? 最佳答案 Enjoy. 在stackov
我在很多地方都看到过这种问题,但还没有找到真正的答案。 有谁知道如何使用 html.jelly 模板使构建日志显示在正文中,而不是全部一起运行并实际用换行符分隔每一行? 我很确定答案在于需要对模板进行
我正在使用 Jenkins 2.2 和 email-ext plugin 2.42(两者都是最新的,我的所有其他插件也是如此)。我将全局配置设置为具有单个显式收件人,并且我的项目使用默认电子邮件通知配
使用 symfony 框架如何从本地主机发送测试电子邮件? 最简单的方法是什么? 谢谢! 最佳答案 我认为最简单的方法(也是我通常做的)是配置 _dev 环境以使用旧版 Gmail(或任何其他提供商)
使用 symfony 框架如何从本地主机发送测试电子邮件? 最简单的方法是什么? 谢谢! 最佳答案 我认为最简单的方法(也是我通常做的)是配置 _dev 环境以使用旧版 Gmail(或任何其他提供商)
我正在使用 sendgrid 发送电子邮件。但是当我尝试按如下方式创建电子邮件对象时 let email = new sendgrid.Email(); email.addTo("rhushikesh
谷歌在这里不是很有帮助。我想用 :set spell 撰写电子邮件上,但对于所有其他文件,:set spell应该关闭。我正在使用 mutt 和 Vim 作为撰写电子邮件的编辑器。 事实上,我很好奇,
我目前在 Windows 7 中使用 Jenkins。 我最近在 jenkins 中运行了一些构建。我能够通过 SVN Post commit 运行构建。 现在我必须通过电子邮件在 Jenkins 中
到目前为止,我已经制作了一个带有登录/注册功能的应用程序,它运行良好。 注册后会发送欢迎电子邮件。 但是我想要做的是在该邮件中发送一个链接,只有在单击它后才能登录。 比如论坛常用的注册邮箱等。 有人可
我工作的公司为医疗保健行业提供测试服务。作为我们服务的一部分,我们需要向客户的员工发送电子邮件。通常,这些人是临时工、兼职人员或契约(Contract)工,因此拥有私有(private)电子邮件地址(
我正在尝试通过 Twitter API 找人。我使用这样的网址:https://api.twitter.com/1/users/search.json?q=some@email.com但是有一个问题。
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 9 年前。 Improve this
我正在使用名为 email-ext 的 Jenkins 插件我想让 Jenkins 发送一封由 html.jelly 生成的电子邮件位于 $JENKINS_HOME/email-templates 中
我是一名优秀的程序员,十分优秀!