Sample CDOSYS mailing script Print

  • 2

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.ReplyTo = "someone@someoneelse.net"
ObjSendMail.TextBody = "this is the text body"
'ObjSendMail.HTMLBody = "this is the HTML body"
ObjSendMail.Send
     
Set ObjSendMail = Nothing
%>

Was this answer helpful?

« Back