Forum Moderators: open
Thanks for your help. I don't really have the coding experience to decipher/understand the asp, nor the time to work out how, for now. I have botched a form with a CDOSYS script I found - it does what I need it to do bar submit the users name. Can you spot the error?
<%If request("submit") <> "" THEN
Set objEMail = Server.CreateObject("CDO.Message")
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Confi = objConfig.Fields
Confi("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Confi("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\inetpub\mailroot\pickup"
Confi.Update
Set objEMail.Configuration = objConfig
objEMail.To = "my.email@email.com"
objEMail.From = Request("from")
objEMail.Subject = Request("subject")
objEMail.TextBody = Request("message")
objEMail.Send
Set objEMail = NothingResponse.Write("<b>Thank you for submitting your enquiry</b>")
Else%>
<form method="post" action="contact.asp">
Name
<INPUT type=text name="name" size="44">
<INPUT type=text name="from" size="44">
Subject
<INPUT type=text name="subject" size="44">
Message
<TEXTAREA name="message" rows=10 cols=37></TEXTAREA>
<input type="reset" name="Reset" value="Reset">
<INPUT type="submit" value="Send" name="submit">
</form><%
End If
%>
Also is it easy to modify the above script so I can add/remove input boxes?
objEMail.TextBody = "Name: " & Request("name") & vbCRLF & vbCRLF & Request("message")
(adds the user name to message with two line breaks before the message box content)
To add other form fields into the message just add:
& vbCRLF & vbCRLF & Request("mynewfield")
to the end of the TextBody line above (it adds two line breaks then the contents of the form box "mynewfield" to the message).