+ Reply to Thread
Results 1 to 5 of 5

CDO Message: The server response was not available

Hybrid View

  1. #1
    Registered User
    Join Date
    03-04-2010
    Location
    South Florida
    MS-Off Ver
    Excel 2007
    Posts
    72

    CDO Message: The server response was not available

    Hello,

    The code below used to work flawlessly when sending email reminders. However, I recently added 2-step verification on my gmail account for
    extra security and now I am getting the error below. Is their a work around?

    Run-time error '-2147220975 (80040211)':

    The message could not be sent to the SMTP server. The transport
    error code was 0x80040217. The server response was not available

    Private Sub Workbook_Open()
        Dim iMsg As Object
        Dim iConf As Object
        Dim strbody As String
        Dim Flds As Variant
    
        Set iMsg = CreateObject("CDO.Message")
        Set iConf = CreateObject("CDO.Configuration")
               
        iConf.Load -1
        Set Flds = iConf.Fields
        With Flds
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
            .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "email@gmail.com"
            .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
            .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
            .Update
        End With
    
        strbody = "Pay Sprint"
    
        With iMsg
            Set .Configuration = iConf
            .to = "email@gmail.com"
            .CC = ""
            .BCC = ""
            .From = " <email@gmail.com>"
            .Subject = "REMINDER"
            .TextBody = strbody
            .Send
        End With
            
    End Sub

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: SMTP Email Problem - CDO Message: The server response was not available

    Hello Orangeworker,

    When sending email using authentication, the server listens on a different port. Change the port number to 465 and it will work.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    03-04-2010
    Location
    South Florida
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: SMTP Email Problem - CDO Message: The server response was not available

    Hi Leith,

    Sorry for my delay...I have been swamped with work.

    I have replaced "25" with "465" in this line of code:

    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    However, I am still getting the same error.

    Thanks.

  4. #4
    Registered User
    Join Date
    03-04-2010
    Location
    South Florida
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: SMTP Email Problem - CDO Message: The server response was not available

    Thanks, Leith. I will look into it and report back. But you don't think it is being caused by the 2-step verification feature from Google, right?

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: SMTP Email Problem - CDO Message: The server response was not available

    Hello Orangeworker,

    The only other issues that could effect you connecting through the secure port (465) would be a firewall or proxy server connection. If you have neither of these on your system then there might be a problem on the server side or with your SMTP account configuration.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1