CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • Using CDOSYS with Google Apps

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    61
  • Date Created
    Thursday, December 2, 2010
  • Last Updated
    Thursday, December 2, 2010
  • This Article Has been Viewed
    2803 times
  • Short Desc
    When using Google Apps, you will have to change your CDOSYS (CDO) SMTPServer and smtpusessl to work with Google Apps Mail Server.
  • Details
    Some Web hosting providers may not be able to give your Mail service with your hosting domain account. This sometimes is caused by companies not wanting to put up with the hassle of trying to make their servers work with all other Email providers available due to issue with different types of SPAM filters that are being made today in combat with the over-sized growing issues of SPAM.

    Google Mail is available through Google Apps. Google Apps gives you a way to host you email through a reliable server without having to deal with issues of SPAM or SPAM filters, as this is all taken care of for your through Google Apps.
  • Recreate Issue
    If you do not properly setup your CDOSYS to work with Google Apps, you will get different errors.
    Such as:

     
    CDO.Message.1 (0x80040213)
    The transport failed to connect to the server.
    /cs/add-ons/mail.asp, line 107


    Follow the code listed below to get your site up and running with Google Apps and CDOSYS
  • Resolve Issue
    To use CDOSYS in Classic ASP with Google Apps, use the following code exactly as it is written, changing the area's that are marked with a ' change

    <%
    Set myMail = CreateObject("CDO.Message")
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.gmail.com"
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true 'Use SSL for the connection
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text)
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="webmaster@domain.com" ' change
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="********" ' change
    myMail.Configuration.Fields.Update
    Subject = request.Form("Subject")
    body = request.Form("body")
    email = request.Form("email")
    myMail.To = "webmaster@domain.com"
    myMail.Subject = ""&subject&""
    myMail.From = ""&email&""

    myMail.HTMLBody = ""&body&""
    myMail.Send
    Set myMail = Nothing

    %>
undefined