Hello friends,

Once again I need a bit of advice on a project of mine.
I am currently building a e-ticket type of system where a person can send an email via php to another person. Before the email is sent, it records the sending of that email in a database, so for example by its message_id header.
When the user which received the email replies and the initial person receives the email, I want to be able to tell which email record in the database that the email was replied to.

Now i have considered the possibility assigning each email a message id, referencing the email record by it and then reading the in_return_to email head in the replied email, but it seems to be that in some emails the initial message ID is lost. The could be to numerous factors, one being that the recepient could have forwarder the email to another email address before replying etc...

Therefore I am looking for an alternative solution or maybe an enhanced idea to what I already have.

Any help would be great!

Thanks in advance

    I do not understand how this should work.

    One person can send email from your php-script.
    This email goes to some email-server somewhere.
    When is read in inbox and replied to, this goes to some email-server somewhere.
    How can you know anthing about this reply?

    If you have one PM, personal message system, it is different.
    Because everything is happening in your php-scripts at you website.

      the message will be replyed to the same mailbox it was sent from

        This solution would heavily depend on your hosting provider (or how much access to the server you have), but I believe it's the most common way to handle something like this.

        You could have the e-mail sent from (and/or reply-to header set to) a fake e-mail address, e.g. eticket-my-username@yoursite.com. You would then enable a "catchall" e-mail address on your server that collects all e-mails sent to your domain that don't have a corresponding mailbox (a.k.a. "real" e-mail addresses). You could then pipe all e-mails received at this catchall box to a PHP script that takes the username (or other identifying mechanism) out of the "to" address and hand it off to your processing code.

          Write a Reply...