I have got the following form working and it emails the form contents to me
As you can see commented out in the code above I tried to get firstName and lastName from the form name field and it doesn't work ?(
I want to add more form fields and need to know what is the ASP code, to have the new fields emailed to me when the form is submitted
I want to add the following fields in my form:
First Name
Last Name
Phone Home
Phone Work
Fax
Address Line 1
Address Line 2
Suburb
State (chosen from dropdown menu)
Postcode
Any help appreciated and thanks for reading my post :]
Code:
<% Dim objCDO
Set objCDO = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
' Outgoing SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.myhost.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'whether you use authentication on the server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "form@myhost.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSCon.Fields.Update
' Update the CDOSYS Configuration
Set objCDO.Configuration = objCDOSYSCon
objCDO.To = "my email address"
'objCDO.Name = Request.Form.Item("firstName")
'objCDO.Firstname = Request.Form.Item("firstName")
'objCDO.Lastname = Request.Form.Item("lastName")
objCDO.From = Request.Form.Item("email")
objCDO.Subject = Request.Form.Item("Subject")
bodyHTML = Request.Form.Item("Comments")
objCDO.HTMLBody = bodyHTML
objCDO.Send
Set objCDO = Nothing
Set objCDOSYSCon = Nothing
%>
As you can see commented out in the code above I tried to get firstName and lastName from the form name field and it doesn't work ?(
I want to add more form fields and need to know what is the ASP code, to have the new fields emailed to me when the form is submitted
I want to add the following fields in my form:
First Name
Last Name
Phone Home
Phone Work
Fax
Address Line 1
Address Line 2
Suburb
State (chosen from dropdown menu)
Postcode
Any help appreciated and thanks for reading my post :]