我无法让我的邮件程序在开发环境中工作。 这是我在development.rb配置:不在本地环境发送邮件
config.action_mailer.default_url_options = { host: 'localhost:3000' }
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.mandrillapp.com',
port: 587,
enable_starttls_auto: true,
user_name: '[email protected],
password: 'mypassword,
authentication: 'login',
domain: 'mandrill.com'
}
我的邮件方法:
class InformationRequestMailer < ActionMailer::Base
def information_request(operator, ref, property_url, contact_info)
@operator = operator
@property_url = property_url
mail(to: operator.email, subject: t("information_request_mailer.subject", property_ref: ref))
end
end
在这里,我称之为:
InformationRequestMailer.delay.information_request(
operator: operator,
ref: ref,
property_url: property_url,
contact_info: params[:contact_info]
)
在此先感谢。
您是否在日志中发现任何错误?我也会假设你在配置的密码字段中输入了''''。 –
什么是OS dev env正在运行?它有'sendmail'或者像是已安装的? – mudasobwa
@JustinWood,我完全没有错。是的,密码有相应的结尾'。我会在这里解决这个问题.. – ntonnelier