Classic ASP sending email with SMTP Authentication



If you would like to send mails using SMTP authentication for your ASP site, then the below content will help you to send authenticated mail.


Dim ObjSendMail
Set ObjSendMail = CreateObject(CDO.Message)

‘Configuration for remote SMTP server

‘Network Send
ObjSendMail.Configuration.Fields.Item ( = 2

‘Name of SMTP server
ObjSendMail.Configuration.Fields.Item ( =

‘SMTP port
ObjSendMail.Configuration.Fields.Item ( = 25

‘MaxESP SMTP servers require authentication

‘Basic Authentication
ObjSendMail.Configuration.Fields.Item ( = 1

‘SMTP username as configured in the control panel
ObjSendMail.Configuration.Fields.Item ( =

‘SMTP user password as configured in the control panelObjSendMail.Configuration.Fields.Item ( =


‘Configuration for email message

‘Email To address
ObjSendMail.To =

‘Email Subject
ObjSendMail.Subject = Subject Content

‘Email From address
ObjSendMail.From =

‘Email Body
ObjSendMail.TextBody = Body Content


Set ObjSendMail = Nothing


Note: In above mentioned code,
replace with your server name for e.g. ( or,
with your user name for e.g. (,
replace with your password,
replace with the mail id of the receiver.

Thank you.

Powered by Facebook Comments

Be the first to comment

Leave a Reply

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