Send an email with your GMail account and CDO Components

by Perk1z 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>

Popularity: 15% [?]

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • LinkedIn
  • Live
  • Print this article!
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb

Related Posts


Web Hosting Pal - www.webhostingpal.com

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image