0
我有我的第一个邮件尝试在手。这是我的邮件...Sendgrid,Heroku梅勒错误网:: SMTPFatalError 553
class UserMailer < ActionMailer::Base
default from: 'http://my-heroku-prename.herokuapp.com'
def welcome_email(current_user)
@user = current_user
@url = 'http://my-heroku-prename.herokuapp.com/'
mail(to: @user.email, subject: 'Welcome to My Awesome Site')
end
end
如果有这条线在我的UserController中结束创建块
UserMailer.welcome_email(@user).deliver
我我production.rb看起来像这样
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = { :host => 'my-heroku-prename.heroku.com' }
ActionMailer::Base.smtp_settings = {
:address => "smtp.sendgrid.net",
:port => 587,
:user_name => ENV['my_actually_sendgrid_username'], #should I just put the default here?
:password => ENV['my_actually_sendgrid_pw'],
:domain => ENV['heroku.com'],
:authentication => plain
有错误我得到的是
Net::SMTPFatalError (553 Parse error at ':' of ('<http://me-heroku-prename.herokuapp.com>', [':', '//my-heroku-prename', '.', 'herokuapp', '.', 'com'])
I'v e搜索了553解析错误,但找不到任何东西......这只是一个synxtax事情吗?
在此先感谢您的帮助。
啊,谢谢! DRR。 – Peege151