1

Does anybody have experience with Postmarkapp?

I have a rails 2 app (radiant cms) and try to send emails through SMTP.

This is how my smtp settings looks like:

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'
}

The Mailer class:

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

and here is the code where I call the deliver method (in a controller action):

mail = RegistrationMailer.create_send_email(params[:email])
RegistrationMailer.deliver(mail)

I got an 'Connection refused - connect(2)' error whenever I call the deliver method. Anybody can help me out what am I doing wrong? I used the exact same code on heroku with other smtp settings (for sendgrid) and it worked without any problems.

Hadi S.
  • 11
  • 4

1 Answers1

0

I haven't used Postmark myself, but there appears to be a gem to help you send mail through their system, it's probably because you have to send through an API key.

https://github.com/wildbit/postmark-rails

http://rubygems.org/gems/postmark-rails

Relevant question for implementation: How can I customize Devise to send password reset emails using PostMark mailer

Community
  • 1
  • 1
lloydpick
  • 1,638
  • 1
  • 18
  • 24