<%
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
'This section provides the configuration information for the remote SMTP server.
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.yourserver.com"ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
' If your server requires outgoing authentication, uncomment the lines below and use a valid email address and password.
'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="somemail@yourserver.com"'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword"
ObjSendMail.Configuration.Fields.Update'End remote SMTP server configuration section==
' gets the variables from the form to use in your mail
getName = request.form("name")
getEmail = request.form("email")
getSubject = request.form("subject")
getMessage = request.form("message")
ObjSendMail.To = "someone@someone.net"' Put in the email address to which you want to send the message.
ObjSendMail.Subject = getSubjectObjSendMail.From = getEmail &"("&getName&")"'Now we are sending the email body.
ObjSendMail.HTMLBody = "This is the first line of your email"ObjSendMail.HTMLBody = ObjSendMail.HTMLBody &"This is the second line of your email"' Now to add your variables to your email body
ObjSendMail.HTMLBody = ObjSendMail.HTMLBody &"Message from: "&getName&"
with email: "&getEmail&"
with subject: "&getSubject&"
With Message:
"&getMessage&""'ObjSendMail.TextBody = "this is the body"
' Now time to send the message.
ObjSendMail.Send
Set ObjSendMail = Nothing
%>