I have a client who wants me to make a script which does this: 1. someone fills out an email with specific fields and emails it to my client. 2. the email fields are entered into fields in the client's database name / project / date etc are type and sent in via email name / project / date are then automatically entered into the database when the email is received by the server. Is this even possible? I don't know why they can't just use a simple form. This is what they want.
Not sure I understand your question. Basically the client will not "know" jobs are coming in. They want jobs to be submitted by email which is then automatically entered into the db.
Ok, let me ask few questions to make it clear for both of us. 1. Do you want to have a form where visitor can fill in details, which when submitted sends an email to client? 2. Is this form already there and you have to integrate email functionality? OR you have to make form from scratch?
it's possible, you have to read the incoming emails with php with imap and then parse the email for the data ... $server = "mail.yourdomain.com"; $user = "incomingemail@yourdomain.com"; $pass = "emailpass"; $conn = @imap_open("{localhost:143/notls}", $user, $pass) or die(imap_last_error());$headers = @imap_headers($conn) or die("No emails found."); $numEmails = sizeof($headers); echo "You have $numEmails emails in your mailbox.<P>"; for($i = 1; $i < $numEmails+1; $i++){ $mailHeader = @imap_headerinfo($conn, $i); $message=@imap_body ($conn,$i); $headers=@imap_fetchheader ($conn,$i); //do your parsing here on the message //$check=@imap_delete($conn,$i); } i use this code for http://www.cbcjobs.com to process job emails
Nope that's not it. That would be easy to do and I'm trying to talk them into that. But they want their server to automatically add emails which are sent in from a template, entered into the DB so an "admin" can deal with them online and process "jobs"... Definitely a "form" would be the easiest.
Thanks califmerchant I'll see if I can figure out how to integrate this. I may have some more questions for you soon...
As it turns out, this client bailed on the idea. I was pretty close to having it all done too. The screwy thing was that some of the UID's didn't convert to variables, some did. I suppose that was because of characters withing the UID?