Page automatically emailed on load

  • Thread starter Thread starter Shona
  • Start date Start date
S

Shona

Hi

I have a form that gets filled in and goes to a database. There is also a
confirmation page is it possible to have the confirmation page automatically
mailed to an email address on load?

Thanks Shona
 
Thanks I'll give it a go but do I add this to the confirmation page or the
form page?

Watch this space I have a feeling I might be back again!

Cheers Shona
 
Hi

Knew I would be back well I have tried that and as soon as I Save I get an
error couldn't open file

The cdonts.exe file just appears to be a word document so is there something
else I should be installing on the web server?

Ive put my email address by To and From and the subject as the first field
objCDOMail.Subject = FP_SavedFields("SalesManagers")

is there something I'm missing?

I also put the script at the end of the confirmation page after the last
field

Any help would be great if you have time

Thanks Shona
 
Hi again!

How do I get the fields in the email to appear in the same order as on the
confirmation page

Cheers Shona
 
Replace the For...Next Loop with separate lines for each field;

strBody = strBody & formfieldname1 & ": " & FP_SavedFields("formfieldname1") & VbCrLf
strBody = strBody & formfieldname2 & ": " & FP_SavedFields("formfieldname2") & VbCrLf
 
Thanks I've tried

For Each item in FP_SavedFields
strBody = strBody & item & ": " & FP_SavedFields(item) & VbCrLf

strBody = strBody & SalesManagers & ": " &
FP_SavedFields("SalesManagers") & VbCrLf

strBody = strBody & Client & ": " & FP_SavedFields("Client")
& VbCrLf

Next

Putting a line for each of the fields but now it won't display the
confirmation page or send the email

I also tried taking out

strBody = strBody & item & ": " & FP_SavedFields(item) & VbCrLf

but unfortunately that didn't work either

Any clues please

Thanks Shona> >
 
<%
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.To = ""
objCDOMail.From = ""
objCDOMail.Subject = FP_SavedFields("Name")
strBody = strBody & "SalesManagers: " & FP_SavedFields("SalesManagers") & VbCrLf
strBody = strBody & "Client: " & FP_SavedFields("Client") & VbCrLf
objCDOMail.Body = strBody
objCDOMail.BodyFormat = 1
objCDOMail.MailFormat = 1
objCDOMail.Send
Set objCDOMail = Nothing
%>
 
Back
Top