CDO SMTP Authentication Mail Script

CDO can be used to send email without SMTP authentication as well as using SMTP authentication. Following is the sample code to send email using CDO SMTP authentication:

<% Set objEmail = CreateObject("CDO.Message") objEmail.From = "" objEmail.To = "" objEmail.Subject = "Test Mail" objEmail.Textbody = "Test Mail" objEmail.Configuration.Fields.Item ("") = 2 objEmail.Configuration.Fields.Item ("") = "SMTP SERVER NAME" objEmail.Configuration.Fields.Item ("") = 25 objEmail.Configuration.Fields.Item ("") = "1" objEmail.Configuration.Fields.Item ("") = "" objEmail.Configuration.Fields.Item ("") = "Email_Account_Password" objEmail.Configuration.Fields.Update objEmail.Send If Not err.number=0 Then Response.write "ERROR: " & err.Description err.Clear end if %>

Make sure that you use appropriate SMTP server, SMTP server port, username and password to send email via authenticatoin.

Kailash Aghera

Leave a Reply

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

Scroll to top
%d bloggers like this: