4

I'm currently creating an email app that is able to send emails to many users. However, I want to know whether there are bounced emails. I'm currently using Amazon SES to notify me if the email is bounced. However, I want the bounced email's data to be automatically entered into my Rails application instead of typing it manually based to the mailer daemons I get from Amazon. Is there are way to do so?

Arafat Nalkhande
  • 11,078
  • 9
  • 39
  • 63
user192249
  • 443
  • 2
  • 6
  • 16
  • 1
    I would recommend using this ruby mail gem https://github.com/mikel/mail. We use this gem in my company to parse all outgoing and incoming email for archiving. You could use the parsing functionality to pull out information from the bounced emails. Hope this helps. – Donavan White Aug 22 '12 at 19:19
  • 1
    Sounds like you just need to connect to the mailbox that get's the bounces and parse the information and insert it into the rails application. I do this but not in rails, I use .net but the concept is that same. I just connect with imap and retrieve the bounces, parse it and update what I need to update. – Henry Aug 24 '12 at 20:59

3 Answers3

0

If you are willing to pay, this SaaS site called bouncely seems to provide an interface and an api wrapper around SES bounces.

lulalala
  • 17,572
  • 15
  • 110
  • 169
0

send_email() returns a response object which can be interrogated for the response metadata.

Compare the status of this with the code you are interested in, perhaps a 550.

dangerousdave
  • 6,331
  • 8
  • 45
  • 62
0

I couldn't find any clean existing solution for this, so I wrote a gem (email_events) that allows you to put a email event handler method (including for bounce events) right in your mailer class: https://github.com/85x14/email_events. It supports SES and Sendgrid, so should work for you if you still need it.

Kent Mewhort
  • 1,158
  • 12
  • 11