Sample CDOSYS mailing script

The following code sample should work on any Windows shared hosting server:

<%
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
     
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.yourdomain.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="somemail@yourdomain.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword"
ObjSendMail.Configuration.Fields.Update
     
ObjSendMail.To = "someone@someone.net"
ObjSendMail.Subject = "this is the subject"
ObjSendMail.From = "somemail@yourdomain.com"
'ObjSendMail.Headers.Add("Reply-To", Request.Form("e-mail"))
ObjSendMail.TextBody = "this is the text body"
'ObjSendMail.HTMLBody = "this is the HTML body"
ObjSendMail.Send
     
Set ObjSendMail = Nothing
%>
Was this answer helpful? 0 Users Found This Useful (0 Votes)