Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capturing email or Sending email to CGI script.

Status
Not open for further replies.

ZsN1Gman

Programmer
Aug 22, 2002
17
US
I help run a small online store that uses a third party processing service for credit card orders. They would like to list the quantity remaining and out of stock status on their product pages. The store uses a simple text based database setup, and the only service they get from the credit processor is an email with order details. I'm thinking we could probably have that "order details" email sent to a cgi script, pluck out the information we need, update the page(s) as needed and then forward that email to whoever would normally get it.

I've never done or seen this done but am sure it's possible. If someone could just point me in the right direction...

Thanks, Jim
 
>> we could probably have that "order details" email sent
>> to a cgi script

how? by what means?

once you did of course you could parse the email contents in your script and do whatever you want to with it.

-pete
 
"how? by what means?"

That's exactly what I'm asking Pete. That email is a stream of data being directed to someone’s email address. How could someone divert that data to a script instead? It may very well not be practical or possible, like I said I've never seen it done. If not maybe someone has some other ideas on how that data could be passed to a script.
 
There are tons of email parsers out there that do exactly what you are talking about. Some are free, and others cost money.

If you wanted to reinvent the wheel, you could probably write a perl script that runs on cron and looks at the /var/mail/useraccount mailbox file and see if it changes. Then you could get the last entry out of it and parse it for the information you are looking for. If you want to do that, it may be a fun thing for the tekies in the forum to wirte together.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top