|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with my simple form please!
Ok, so I'm partially there to get my form working in my visual web dev page. (My web developer left us so I'm filling in!) I had someone supply me with a form processor but now I don't know how to connect it to info I want emailed from an online form.
The mail processor is (on a seperate page in my website called testemail.asp): <%@ Language=VBScript %> <% Dim objSendMail Set objSendMail = CreateObject("CDONTS.NewMail") With objSendMail '.BodyFormat = 0 '.MailFormat = 0 .From = "WebMaster@mycompany.org" .To = "me@mycompany.org" .Cc = " " .Subject = "Test Email - IIS Server" .Body = "This is a test email" .Send End With set objSendMail = nothing Response.Write("Test Email Sent") %> _________________________________ The form fields I need to capture on my online page which is .aspx are: Physician Name: Physician NPI: Sender's Email: Sender's Name: _________________________________ How do I get the form fields to send the data to me via the testemail.asp page? I have a hard time figuring this out because the entire site is .apsx pages and when I put in vb code it messes it up as I'm not too versed in coding. Any help is appreciated! Thank you |
|
#2
|
|||
|
|||
|
This is the issue!! my .aspx webpage that contains my form has the <form> line calling out an incorrect command that I cannot figure out since I don't know VB.
The form works fine as an html page but not as .aspx page in visual web. Here is the line on my form page that calls out my formmail.asp page to send my online form data. <form method="post" action="~/formmail.asp"> the action="" command I'm guessing isnt right so it doesnt send my info to the formmail.asp page. What code should i put in there to send my online form correctly?? ![]() |
|
#3
|
||||
|
||||
|
That's not vbscript or ASP, or even asp.net, it's just html code for a form. If the formmail.asp page is in the same directory as this page then just have action="formmail.asp"
If it's one directory up (which I doubt), then action="../formmail.asp" |
|
#4
|
|||
|
|||
|
Quote:
No I know that line is just html - I tried action="formmail.asp and nothing happens. Formmail.asp is in my root dir for right now. |
|
#5
|
|||
|
|||
|
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <% Dim strMessage strMessage = Request.Form("Physician Name") & request.Form("Physician NPI") & request.Form("Sender's Name") theSchema="http://schemas.microsoft.com/cdo/configuration/" Set cdoConfig=server.CreateObject("CDO.Configuration") cdoConfig.Fields.Item(theSchema & "sendusing")= 2 cdoConfig.Fields.Item(theSchema & "smtpserver")="your smtp server address" cdoConfig.Fields.Update Set cdoMessage=Server.CreateObject("CDO.Message") cdoMessage.Configuration=cdoConfig cdoMessage.From=Request.Form("Sender's Email") cdoMessage.To="your email address" cdoMessage.Subject= Request.Form("subject") cdoMessage.TextBody= strMessage cdoMessage.Send Response.Redirect("http://www.yourwebsite.com") Set cdoMessage=Nothing Set cdoConfig=Nothing %> </body> </html> |
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > Help with my simple form please! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|