Page 1 of 1
redirecting email to a MySQL database
Posted: Fri Feb 28, 2003 8:32 am
by permutations
I have a big problem to solve on my site, and I'm not sure how to approach it. I'm selling software that's distributed as trialware (will be--haven't launched yet). Users will be able to unlock the time-limited versions with a license. I want to send the license to the user after her payment has been received, but here's the rub: I'm not handling the payments myself. I'm using 2Checkout.com and possibly PayPal. 2Checkout will send me a confirming email message when an order has been completed, but I don't want to have to manually generate and mail out licenses.
There's been mention here about email somehow being redirected into a MySQL database. I'm not sure how that works. Is there any way that I can somehow redirect the 2Checkout.com notifications to my database and act on the event of receiving this email? I don't know how else the process could possibly be automated.
Any ideas would be greatly appreciated.
Posted: Sat Mar 01, 2003 11:55 pm
by thedude
You would have to make changes to your incoming mail server. I know that with sendmail you can setup an alias which can run a PHP or Perl script to parse the e-mail and put the information into a database.
Posted: Sun Mar 16, 2003 3:27 pm
by Ron Woolley
....AND you need root super user access and OS knowledge to program it all - i.e your own box or a leased dedicated one - not just shared hosted.
"thedude" is quite correct. Just because you have a site domain that corresponds to the pop account don't think the mail server and web server are all the same - chalk and cheese!
However
You have a business; get a merchant account (if not already).
Then use a real Payment Gateway Service where both the cart AND receipt of success/failure responses from same (gateway through bank to CC provider and back again almost instantly) can be based on your site.
Most decent carts facilitate bi directional real time Gateway comunication so it would not be too much to program extend the backend to do what you want.
BUT ALSO
In fact the cart response to the user (after authorisation success) can then be programmed to (or open another form of a different process) auto generate links to download and what ever.
That way you can even go bush and the automated operation will not need you at all.
Your licencing etc could even be associated with a unique account number generated by most carts anyway.
That is all quite commonplace.
At least it is all just confined to your site so programming or getting stuff programmed is completely under your control (and transportable).
First you get a merchant account, then decide on a cart system that either supports, or will usually for a small fee plug your gateway processing in to it. Most already come with most common US "gateway" processing plugged in by default.
Food for thought. Hope the info helps.
Posted: Tue Mar 25, 2003 11:06 am
by permutations
I thought I'd post the solution I found. It turns out that in the most recent version of CPanel, you can add an alias that will pipe mail to a PHP script. This is good because I don't have to be an administrator of the server to do it. I'm using 2Checkout.com rather than getting a merchant account. Also, I wrote my own shopping cart in PHP. I wanted everything just so, and the only way to do this was to program it myself. It wasn't that hard.