Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a form that can be e-mailed Dreamweaver vs FrontPage

Status
Not open for further replies.

ag5t

Technical User
Joined
Feb 8, 2002
Messages
70
Location
US
I keep running into a problem with FrontPage extensions not available so I can't publish a form. Is there a way to make a form in Dreamweaver - where someone can fill it out and then e-mail it to me? Is it cgi? Do I need some kind of server extensions? Thanks for your help.
Marty
 
You can use CDONTS email for this

Sub SendCCEmail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "whoever@xxxxx.com"
objMail.To ="person@xxxx.com"
objMail.Subject = "Email thanks" & strBody & " For: Customer: " & txtCustomer_Id & " Ispec Unit: " & txtIspectrum_Code & " Date: " & txtRunDate

(fields txtCustomer_Id and txtIspectrum_Code are the form fields values).


strBody = Now() & " " & vbCrLf & strBody & vbCrLf
objMail.Body = strBody

objMail.Send
Set objMail = Nothing
End Sub

Calling sub in program
Call SendCCEmail

This is if you are using IIS on Windows 2000 or 2003 server
 
I should add that you can not use CDO(NTS) with Windows Server 2003. It is no longer supported. CDO must be used in 2003 and is also supported in 2000.

The code is very similar to Tracey's code above.

Code:
<%
dim reqSvr,iMsg,iConf,Flds,HTMLstr

reqSvr = Request.ServerVariables("SERVER_NAME") 

Const cdoSendUsingPort = 2

'Process Annuity Request Form

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

With Flds
	.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = cdoSendUsingPort
	.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "127.0.0.1"
	.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")[/URL] = 10
	.Update
end With

HTMLstr = "<p>The following information was submitted .</p>"

with iMsg
	set .Configuration = iConf
			
	.From = Contact_Email
	.To = "yourmail@yourURL.com"
	.Subject = "Form Submission"
	
	.HTMLBody = HTMLstr
	.Send
end with

Set iMsg = nothing
set iConf = nothing
set Flds = nothing
%>

Hope it helps,

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top