How to implement the "reply to this email" function for my web application?

I have an application that sends emails when a user creates / modifies an entry. I would like my users to be able to reply to the email they send and the web application will receive the email, analyze it and automatically update the record. I saw this in web apps like Basecamp. The letter usually says β€œThe answer is above this line,” and if you simply reply to the letter, you do not need to log in to the web application to update your ticket / conversation.

How can I implement such functionality? (I'm not looking for a specific implementation of the language, but rather an agnostic solution to the language).

+7
source share
3 answers

There are two ways to do this:

  • You can use the Procmail filter to connect the incoming message to your script. This will require some know-how to set up, but it is certainly possible to do what you described using this method.

  • Use a service such as MailGun - they do all the hard work of setting up and configuring the mail server material and exposing it to you through a good programmable web API. I rate it this week to solve a similar problem similar to the one you have, and I can tell you: it is really great, and I highly recommend that you check it yourself.

+3
source

You will need to implement a service / daemon that will poll the email inbox for new messages. To associate an incoming e-mail with the corresponding data, you can include the identifier in the subject of the outgoing message.

0
source

I agree that you should create a system for receiving incoming letters, but I do not always agree that the survey is the right decision. Take a look at the blog post I wrote on this topic here . This applies to Rails, but concepts should work in any language. That's why we wrote CloudMailin to provide the best way to receive email.

You can also use a unique address for each letter, which will not allow the user to change the topic of the subject, which is a problem. The disposable part of the email address is useful for this. answer+user123@example.com for example.

0
source

All Articles