<%
set objMessage = createobject("cdo.message")
set objConfig = createobject("cdo.configuration")
Set Flds = objConfig.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="[Mail Server Name]"
' ' Passing SMTP authentication
Flds.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
Flds.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="postmaster@mydomain.com"
Flds.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="password"
Flds.update
Set objMessage.Configuration = objConfig
objMessage.To = "postmaster@mydoamin.com"
objMessage.From = "postmaster@mydomain.com"
objMessage.Subject = "New Task"
objMessage.fields.update
objMessage.HTMLBody = "This is a test sent from CDO using smtp authentication."
objMessage.Send
%>
If you run into problems when using this code, please post in the DiscountASP.NET or Everleap community forum. Technical support is unable to assist with specific coding issues.
Article ID: 1057, Created: July 2, 2012 at 7:36 AM, Modified: May 4, 2015 at 4:30 PM