有人有使用 Postmarkapp 的经验吗?
我有一个 rails 2 应用程序(radiant cms)并尝试通过 SMTP 发送电子邮件。
这是我的 smtp 设置的样子:
config.action_mailer.smtp_settings = {
:address => "smtp.postmarkapp.com",
:port => '25',
:authentication => :plain,
:user_name => 'postmark-ap-key',
:password => 'postmark-ap-key',
:domain => 'postmarkapp.com'
}
邮件类:
class RegistrationMailer < ActionMailer::Base
def send_email(email, sent_at = Time.now)
subject "Some text here"
recipients "#{email}"
from 'xxx@yxz.com'
sent_on sent_at
body :text => "Some text here"
end
end
这是我调用交付方法的代码(在控制器操作中):
mail = RegistrationMailer.create_send_email(params[:email])
RegistrationMailer.deliver(mail)
每当我调用交付方法时,都会收到“连接被拒绝 - 连接 (2)”错误。任何人都可以帮助我解决我做错了什么?我在 heroku 上使用了完全相同的代码和其他 smtp 设置(用于 sendgrid),它没有任何问题。