Send to user in database

L

Lizz

I have a page which i need sent via email when user hits submit button
here is an example of the CDo code i'm using which is not working.
Please help


<%

Dim objMessage

Set objMessage = Server.CreateObject("CDO.Message")

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2 'Send the message using the network (SMTP over the network).

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "127.0.0.1"

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")
= False 'Use SSL for the connection (True or False)

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 60

objMessage.Configuration.Fields.Update

With objMessage
...To = "cust_email"
...From = "Test <[email protected]>"
...Subject = "Thank You"
...TextBody = "Name: " & Request("cust_name") & vbCRLF & vbCRLF &
"Email: " & Request("cust_email") & vbCRLF & vbCRLF & "Message: " &
Request("emailtext")
...Send
End With

Set objMessage = Nothing

%>


The fields in the form are obvious from the text body part of the
script. Any help apprciated.

Lizz
 

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

Top