Page automatically emailed on load

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
 
S

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
 
S

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
 
S

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
 
S

Stephen Travis

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
 
S

Shona

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> >
 
S

Stephen Travis

<%
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
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top