How to assemble fields into a body element in ASP
Okay -- I have created numerous HTML forms and used Formmail to send them under Unix. Now I have a client whose hosting package is limited to Windows 2003 server and ASP. The only way I can send form email is through CDO.
Using some of the ASP scripts I have found online, I can succesfully send a email form through CDO under ASP. That is great, however, it appears that CDO is limited to the fields I can use -- To, From, Subject, Body, etc. unlike Formmail which will process any form field you throw at it. It appears that I have to assemble any additional fields into a text block that can be sent through the body element. This is where I am stuck. I am trying to add additional fields as follows:
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.TextBody = "Name: " & Name & vbCrLf & _
" Phone: " & Phone & vbCrLf & _
Body & vbCrLf & "."
objCDO.Send
When I attempt to send via this script I get an "Invalid Visibility" error in the objCDO.Send line.
If I reduce the code so that the objCDO.TextBody line reads:
objCDO.TextBody = Body
then the script works fine and will send a11 the elements via eMail.
My client wants the Name and Phone fields to be included in the body element. Can anybody suggest how to assemble the aa so it can be sent in the body element?
|