CFMAIL & CFINSERT output on 1 form???

New User fills out relevant info. on a FORM, "A.CFM"  Upon completion, hits the SUBMIT button.

I'm trying to send the contents of this form as an email, as well as to INSERT it into my database.

How would I get the form to process both the needs?  Kindly explain the syntax.... I would like the FORM ACTION of "A.CFM" to go to "B.CFM", which is a success notification page, once the data from the form has been emailed and inserted into the database, simultaneously.

Please respond ASAP!  Thanx!!

Ashish Rajput
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

it's as simple as doing both individualy, to put the stuff in your
database, you can use CFINSERT, or make a query with the update statmenet in the b.cfm file, then use the cfmail to post it.

here is an exemple, i hope this will help you out

<!--- Content of a.cfm --->
<cfform method=POST name="application" action="b.cfm">
<cfinput type=text name="email" required="yes" size=25>
<cfinput type=text name="name" required="yes" size=25>
<cfinput type=text name="login" required="yes" size=25>
<cfinput type=password name="pass" required="yes" size=25>
<input type="submit" value="Send">
<!--- end of Content of a.cfm --->

<!--- Content of b.cfm --->
<CFINSERT DATASOURCE="#datasource#" TABLENAME="table" FORMFIELDS="field1, field2, field3">

   <CFMAIL TO="" FROM=""    SUBJECT="Message Subject">
<!--- Mail content --->    
     Here is the info you submitted
      Login: #form.login#
      Pass: #form.pass#
<!--- end of Content of b.cfm --->

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
then you can put at the end of b.cfm the notification to user "Your form was processed correctly thanks bla bla bla"

if an error occrure before, that message will not apear
please tell us that you solve the problem or not if not then rejected and we will try to solve your problem
20 pts for this one!  someone cashed in big!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.