Send an email with your GMail account and CDO Components

by Herman Tarigan on July 18, 2007

<%
Set objCDOSYSMail = Server.CreateObject(“CDO.Message”)
Set objCDOSYSCon = Server.CreateObject (“CDO.Configuration”)
objCDOSYSCon.Fields(“http://schemas.microsoft.com/cdo/configuration/smtpserver”) = “smtp.gmail.com”
objCDOSYSCon.Fields(“http://schemas.microsoft.com/cdo/configuration/smtpserverport”) = 465
objCDOSYSCon.Fields(“http://schemas.microsoft.com/cdo/configuration/smtpusessl”) = true
objCDOSYSCon.Fields(“http://schemas.microsoft.com/cdo/configuration/smtpauthenticate”) = 1
objCDOSYSCon.Fields(“http://schemas.microsoft.com/cdo/configuration/sendusername”) = “myemailaccount”
objCDOSYSCon.Fields(“http://schemas.microsoft.com/cdo/configuration/sendpassword”) = “mypassword”
objCDOSYSCon.Fields(“http://schemas.microsoft.com/cdo/configuration/sendusing”) = 2
objCDOSYSCon.Fields(“http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout”) = 60
objCDOSYSCon.Fields.Update
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = “myemailaccount”
objCDOSYSMail.To = “myfriend”
objCDOSYSMail.Subject = “This is my subject for my test message smtp gmail”
objCDOSYSMail.HTMLBody = “This is the body ”
objCDOSYSMail.Send
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
%>
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title>Email</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>
<body>
Email has sent!
</body>
</html>

Herman Tarigan

Pernah menjadi Operator warnet, Customer Service Webhosting, System Administrator Webhosting, Website (SEO) Consultant, Operational Manager, Marketing dan sekarang memilih menjadi FREELANCE :)

Incoming search terms for the article:

mikrotik smtp gmail, email settings gmail mikrotik, mikrotik error sending email error connecting to server, mikrotik smtp gmail com, objcdosyscon fields gmail
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • LinkedIn
  • Live
  • Print this article!
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word