Configure ASP to send mails via gmail

‘Create CDO.Message object instance
Set myMail = CreateObject("CDO.Message")

‘Set SMTP Authentication
myMail.Configuration.Fields.Item("") = 2 ’1 means using local smtp, 2 is for outside smtp

‘SMTP Server domain name
myMail.Configuration.Fields.Item("") = ""

‘Server port, gmail use ssl smtp authentication, port number is 465
myMail.Configuration.Fields.Item("") = 465
‘Authentication method, ssl or not, Username and password for the SMTP Server
myMail.Configuration.Fields.Item("") = 1 ‘CDOBasic authentication
myMail.Configuration.Fields.Item("") = true
myMail.Configuration.Fields.Item("") = "Gmail Address"
myMail.Configuration.Fields.Item("") = "Gmail Password"


myMail.Subject = strSubject
myMail.From = strEmailFrom
myMail.To = strEmailTo
myMail.TextBody = strBody

set myMail=nothing


- has written 121 posts.

Leave a Reply

You must be logged in to post a comment.