I'm working on email messaging / tickets system.
Logic:
- Client starts new ticket on website, which is stored in database
- I'm getting email about new ticket in my inbox (generated by website, with unique
ID
in subject line) - Replying email (reply-to email address e.g.
tickets@example.com
) PHP
cron
script reads inbox, getting all messages, storing them to database and generating email to client.- Client replies to email (reply-to email address -
tickets@example.com
withID
in subject line)
Question:
How I can read where is new reply text and old one from email
? Email
with reply example:
Envelope-to: tickets@example.com
From: client@example.com
To: tickets@example.com
Subject: Re: New Ticket: "Project #1" (ID: 15)
Message-ID: <70c4e4c182e6eb10c0e45feefa4ce9cg@example.com>
This is reply to message.
On 2014-05-13 09:04, Client wrote:
> This is text
>
> ----
> Best Regards,
> Client
I need to have only latest reply. Client can write reply on bottom or on top (anywhere to be honest), with any mail
client, and I bet - a lot of mail
clients have different formatting..
Any suggestions?