Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-29-2010, 09:16 PM   PM User | #1
RyanB88
Regular Coder

 
Join Date: Mar 2005
Location: Spokane, WA
Posts: 146
Thanks: 4
Thanked 3 Times in 3 Posts
RyanB88 is an unknown quantity at this point
Useage of PHP's Mailparse Functions

I am building a PHP based helpdesk ticketing system, yes I know there are lots of them already made, but I am specifically making this as a plugin to my CMS, Wordpress, for which is is no viable and affordable option that I could find.

For the most part this is fairly straight forward, the one thing giving me problems is I have to allow users to send an email and generate a ticket from that. I plan of having my web server pipe the incoming emails to a PHP script, this is easy enough to do with cPanel. And I use standard input to receive the message, now I am looking to parse it into its parts, while looking for a way to do this the best option I could find is Mailparse, the problem is I have no clue how to use it, and PHP's documentation isn't any help. I could really use some actual code examples of this in action to help out.

What I need to do to the incoming email is this:

* Get the From Address, To Address, and Subject from the headers
* Use substring on the Subject to get the ticket id (for replies to existing tickets)
* Identify the user the ticket is for using the From Address
* Identify the department the ticket is for using the To Address
* Obtain the plan-text version of the email body (if there is only an html version I do have a class I can use to strip out the html and make a plain-text version)
* Ignore any quoted text in the email body, and focus on the new text which will be the content for the ticket.

So what I need help doing using Mailparse is obtaining the header information and message body, and stripping out the previous quotes message(s) from the body to get just the new reply.

Any help would be greatly appreciated, Thanks in Advance.
RyanB88 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:39 PM.


Advertisement
Log in to turn off these ads.