|
-
May 26th, 2010, 05:07 AM
#1
Thread Starter
Addicted Member
Splitting and Counting emails.
I do apologise - as I have no idea how this is done. But I have an inbox (Web based) which contains hundreds of emails. All with the same subject:
"Transcript of <date>. Visitor: <name>. Operator: <name>."
An example of the date would be: "26 Mar 2010 14:59:10"
I was wondering how possible it would be to set a cron job or some script to run through the email inbox. Then split out just the date and the operator name and insert it into a database table with 3 enteries. One for total no. of calls for operator. One for no. of calls over the past 30 days and one for the no. of calls over the past 7 days.
This could then be pulled out of the database by a PHP script (i can sort that) which will display it in a user area on a wbesite.
I hope somebody can help me!
Adam
-
May 26th, 2010, 08:20 AM
#2
Re: Splitting and Counting emails.
Mail is just stored in text files. For a hosting account of mine, mail is stored in the directory /home/hosting_username/mail/domain/mail_username/, with /cur/ holding the current mail. here is an example of the first filename/contents:
1267711513.H960979P14748.alpha.unisonplatform.com,S=1000:2,Sa
Code:
Return-path: <[email protected]>
Envelope-to: [email protected]
Delivery-date: Thu, 04 Mar 2010 08:05:14 -0600
Received: from 174.37.53.166-static.reverse.softlayer.com ([174.37.53.166]:51453 helo=pub2)
by alpha.unisonplatform.com with esmtps (TLSv1:AES256-SHA:256)
(Exim 4.69)
(envelope-from <[email protected]>)
id 1NnBfs-0003pF-PS
for [email protected]; Thu, 04 Mar 2010 08:05:13 -0600
Received: from www-data by pub2 with local (Exim 4.63)
(envelope-from <[email protected]>)
id 1NnBfr-0000uu-Nl
for [email protected]; Thu, 04 Mar 2010 08:05:11 -0600
To: [email protected]
Subject: Quicktate confirmation
From: [email protected]
Message-Id: <E1NnBfr-0000uu-Nl@pub2>
Date: Thu, 04 Mar 2010 08:05:11 -0600
X-Spam-Status: No, score=3.2
X-Spam-Score: 32
X-Spam-Bar: +++
X-Spam-Flag: NO
Please click the link below to confirm your registration to Quicktate.com:
http://www.quicktate.com/quicktate/members/customers/verify/ry4u8mwhrhhkssnicyo6epq7wjqehqr1
All you have to do is find these text files, and then parse them. You would probably want to organize them into folders depending on whether they have been parsed or not, too, and have them in a separate email account other than your personal account (if this is not done already).
You would have a cron job running a PHP script that did the parsing -- but I'm not sure if you need help with parsing or not. This should give you some stuff to look for anyway.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|