質問

I am designing a support ticket system in PHP and would like for support tickets to be automatically created when an email is sent to a specific email address.

For example, if someone emails support@mydomain.com, when the incoming mail arrives on the server, a support ticket is created (however I code that). Also, when someone replies to an email with an existing support ticket number in the subject, it will add that email reply to the existing ticket.

So, basically, I want my server to monitor any incoming messages to a specific email address. When messages arrive, take it and run it through a php page and I can break it down from there.

How is this done? I've seen it done many times with hosting companies, etc. You can respond via email and support tickets are automatically created.

Thank you!

役に立ちましたか?

解決

You basically need to set up an IMAP server and have your PHP script poll for new messages, then track them accordingly. That's really the only, or at least, the most straightforward way.

他のヒント

I am currently developing a plugin for a CMS which will enable you to contribute content by sending an email - and the approach is compareable. Basically you need a dedicated mailbox (POP3 works as well - and don't get confused by naming: imap_ open can also access POP3- Mailboxes) and then:

Foreach (messages as msg) {
    If (Processing()) imap_delete(msg); // bool=success
 }

The implementation of "Processing" is left as an excercise to the reader ;-)

Or you could use the mailgun api that does the heavy lifting for you.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top