HostOnNet Blog

Sending Mail With ASP on Windows 2008

Looking for Linux Server Admin or WordPress Expert? We can help.

To send mail with ASP on Windows 2008, create an email address on WebSitePanel, replace “YOU@YOURDOMAIN.COM” with email address you created. Replace PASSWORD with password of the email account created.

Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
'This section provides the configuration information for the remote SMTP server.
ObjSendMail.Configuration.Fields.Item ("") = 2 'Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("") ="localhost"
ObjSendMail.Configuration.Fields.Item ("") = 25
ObjSendMail.Configuration.Fields.Item ("") = False 'Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("") = 60
' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
'ObjSendMail.Configuration.Fields.Item ("") = 1 'basic (clear-text) authentication
'ObjSendMail.Configuration.Fields.Item ("") ="YOU@DOMAINNAME.COM"
'ObjSendMail.Configuration.Fields.Item ("") ="PASSWORD"
'End remote SMTP server configuration section==
ObjSendMail.Subject = "this is the subject"
' we are sending a text email.. simply switch the comments around to send an html email instead
'ObjSendMail.HTMLBody = "this is the body"
ObjSendMail.TextBody = "this is the body"
Set ObjSendMail = Nothing

Response.Write "Mail Send"

Posted in Programming

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.