Sending the Email is the easy part. Any formmail script handle that with little or no modification. The tricky part is combining these two functions with a single form submission.
The simplest solution that comes to mind would be to add a call to a JavaScript to your form that would use AJAX to send the form data to a mailer script and then allow the form to be submitted to the payment processor normally. The main drawback of this would be that the system would require that JavaScript be enabled in the user's browser. While extremely few people run with JavaScript disabled these days, the number isn't zero, but this may be the least intrusive method.
The alternative would be to create an intermediate script that would handle the mailing and then proceed to submit the form data to the payment processor. I had to do something similar not long ago and ran into some HTTP security issues. You can't, for example, use method="post" and have the destination script respond with a 301 or 302 redirect. I ended up having the formmail script display a "Continue" button which was a part of a form that submitted the user's data to the payment processor. It was clumsy, but I was under a tight deadline and it worked.
Rick Trethewey
Rainbo Design
Bookmarks