Reputation: 9040
Im building an email management software using PHP. Im a bit stuck on something, and thought SO might provide some insight. The user retrieves messages. Messages get replied. I was thinking that I could create some sort of custom hash for an incoming message, store the data and hash in the database, and then for replies, inject the custom hash into the message header to denote that this message being sent is apart of that particular incoming message.
Is this a good theory to use? Any suggestions or comments? I really have no experience in this and Im just trying to figure out the best method for implementation.
** NOTE: If there are any open-source PHP email management software that I could reverse-engineer, that would also be something I would be interested in looking at.
Upvotes: 1
Views: 1110
Reputation: 5211
Injecting custom headers into the message is possible but it's pretty rare that they would be included in the reply. Sometimes, clients will include a In-Reply-To header, that quotes the original message id and you can use that.
However, the easiest and most common method of doing this is by using a customised from address. If you send the email from [email protected]
then any bounces or replies will come back to that email address. If the next message uses [email protected]
then you can easily tell which reply is for which original message.
There are a few options when receiving the emails:
I wrote a blog post outlining the methods to receive the messages, it was for Ruby but the same principals all apply. Unfortunately I don't know of any PHP software for this.
Upvotes: 2