【发布时间】:2018-01-20 07:08:20
【问题描述】:
我构建了一个示例应用程序来尝试使邮件程序正常工作。该应用程序托管在https://blooming-brushlands-80122.herokuapp.com, 源代码是here。这是我与动作邮件相关的配置:
config.action_mailer.delivery_method = :sendmail
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_options = {from: 'no-reply@example.com'}
用于发送邮件
def create
@user = User.new(user_params)
respond_to do |format|
if @user.save
# Sends email to user when user is created.
ExampleMailer.sample_email(@user).deliver
format.html { redirect_to @user, notice: 'User was successfully created.' }
format.json { render :show, status: :created, location: @user }
else
format.html { render :new }
format.json { render json: @user.errors, status: :unprocessable_entity }
end
end
end
该应用不会向用户发送电子邮件。
有人知道为什么吗?
【问题讨论】:
-
请不要大喊大叫
-
改了标题_
-
发布您发送邮件的代码以及您的配置文件
-
更新了问题
标签: ruby-on-rails ruby ruby-on-rails-4 smtp sendmail