-3

The exact problem is:-

I'm currently developing ticketing system using PHP. System will send emails automatically to the concerned departments once a ticket is opened. The emails recipients will reply this email using their third party application like outlook thunderbird or whatever. So the mailing process will be away of my system, at the same time i should take an action once one of those emails replies. What i thought of is:- When the ticket opened i send this email to my own email, So when users reply this emails i would be in the loop, So i could have an action when i receive this reply.

So any other suggestions ?

1 Answers1

0

The Golden Rule of Developing

Don't Reinvent the Wheel

The internet has been around for a long time it is likely someone has had a need to solve the same problem you are trying to solve now.

In this case there are many Support Ticket Systems currently available, many work with PHP and databases.

One option is osTicket this can be downloaded and used completely free of charge, and includes many features including. * Custom Fields * Rich Text HTML * Ticket Filters * Auto-Responder * Customer Portals * Reports * Email Piping, POP3, and IMAP functionality (osTicket uses cron jobs to check the email accounts).

If you haven't already had a look at it might be able to solve your problems and save you some time.

Invent Your Own Wheel

Keep in mind that email can be treated like any other form of standard input.

PHP IMAP Functions

The commands to use IMAP in PHP are imap_open to connect and imap_search to obtain the emails. The PHP Manual steps through all of the available functions, and syntax in their IMAP Book

Check Email Functions

If using IMAP functions you would need a method to periodically check your email account for new mail, An inefficient way to do this has previously been shown on StackOverflow Question 11766165. You could also use an AJAX function, cron job, or Windows Task Scheduler (there would be many other ways to do this).

I understand that to mean you want to use Ajax for the purpose of initiating and re-initiating the script? You would just have to refresh the page to have the script run again. Did you know that you can run PHP scripts without a web browser? cron or Windows Task Scheduler will perform this task as long as their is a PHP interpreter running on the server.

Community
  • 1
  • 1
James
  • 16
  • 4