We help IT Professionals succeed at work.

Passing info from a form to an e-mail

paulvb asked
I know how to send info from a form with an .htm extension to an e-mail, but how can I send info from a form with an .asp extension to an e-mail?

Watch Question

paulvb -

As far as I know, the bots in FP (including the email results bot) will not work on a page with an ASP extension.  Either place the form on a non-active server pages page or use CDONTS to send the mail via ASP.  If you're using ASP to include content, try using the FP component instead.  In any case, try to isolate the form on an html page or use other FP compenents to perform the functions currently handled by your ASP scripts on the form page.

HTH :)




That makes no sense to me. PLease explained more, my knowledge of .asp is limited.
Hi Paul....

Let's not give ASP too much credit here.....an ASP page is EXACTLY the same as and HTML page....except that the sever processes it before it hands it to the browser.

Therefore, you pass a form from  an ASP page in the exact same manner as you would an HTML page...by specifying the form action in the Form Properties Dialog box.  The likelihood is that you will need to go into either the advanced or options tab from the dialog, but Email results will be in there.
ClassyLinks, it's been my experience that the results bot called from an asp page doesn't work.  Instead of going to the designated confirmation page, the form page reloads and no mail is sent.  If the same form is contained on an htm or html extension page, the bot works.  Not sure if the extensions correctly parse *.asp for FP components.  Please let me know if you have other experience with this that would allow it as this was something I also ran into recently.

I was trying to point out to Paul that he can use the bot if he finds other ways of accomplishing whatever is being done by the asp code on the form page, or by placing the form on a non-asp page.

Paul, could you post your code and we can have a look?
Naturally AvocadoIsle, my preference is not to use the bots at all!  They are totally unreliable (IMHO).  

However, form actions work the exact same way on asp pages as they do html, and I've not had a problem submitting a form from an asp page at all.

All that being said, you are again correct.  Seeing Paul's code will help.
How's this one going Paul??


What I want to do can't be done, the closest I have come would be to do something like  what I had found at Microsoft.com.
Here is the URL


Still waiting for some suggestions.

Paul...the easiest way is to find out from your hosting company what email component they have sever side (CDONTS is probably the most likely) and code for the form to send it directly server side.
what do you want to do Paul?
You may also want to look into JMAIL...that's an alternative to CDONTS.  Very easy to use.  
Again....you need to know what is installed on the server.....JMail or DCOnts or ASPMail or something else.  Unless you know........?
Hi paul,

I currently use the get method from a form to transfer the results of the form to another asp page that then emails the data out to an email address which can be a variable as well.

Heres the Code for the receiving as page. You will need to make sure cdonts is working. it took me a few weeks to work this out.!!!

***Declare your Variables insert between Head and Body.***
Dim Aitem
Dim Bitem
Dim WordA
Dim Email

*** Get info from text fields passed from other page using get method with Querystring and place in variables.  Put this in the body part.***

        WordA ="This information is confidential and has been requested and sent by "
        Aitem="Customer ID No.    - "
        Aitem=Aitem & CStr(Request.QueryString("ID"))
        Bitem="Customer Name.     - " 
        Bitem=Bitem & CStr(Request.QueryString("COMNAM"))
*** last part that emails all variables and then clears cdonts. This goes after the body.***

Set MyCDONTSMail=CreateObject("CDONTS.NewMail")  
MyCDONTSMail.From="email address of user"    
MyCDONTSMail.Subject="Enter subject info here"
MyCDONTSMail.Body=WordA & vbCrLf & WordB & vbCrLF    
set MyCDONTSMail=nothing

Leon Summers.

You have many open questions:


To assist you in your cleanup, I'm providing the following guidelines:

1.  Stay active in your questions and provide feedback whenever possible. Likewise, when feedback has not been provided by the experts, commenting again makes them receive an email notification, and they may provide you with further information. Experts have no other method of searching for questions in which they have commented, except manually.

2.  Award points by hitting the Accept Comment As Answer button located above and to the left of that expert's comment.

3.  When grading, be sure to read:
to ensure that you understand the grading system here at EE. If you grade less than an A, you must explain why.

4.  Questions that were not helpful to you should be PAQ'd (stored in the database for their valuable content?even if not valuable to you) or deleted. To PAQ or delete a question, you must first post your intent in that question to make the experts aware. Then, if no experts object after three full days, you can post a zero-point question at community support to request deletion or PAQ. Please include the link(s) to the question(s).
CS:  http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
At that point, a moderator can refund your points and PAQ or delete the question for you. The delete button does not work.

5.  If you fail to respond to this cleanup request, I must report you to the Community Support Administrator for further action.

Our intent is to get the questions cleaned up, and not to embarrass or shame anyone. If you have any questions or need further assistance at all, feel free to ask me in this question or post a zero-point question at CS. We are very happy to help you in this task!

community support moderator

Explore More ContentExplore courses, solutions, and other research materials related to this topic.