Results 1 to 3 of 3
  1. #1
    slam19s is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    2

    CDO.Message No Longer Working (Gmail) - Failed to Transport Error

    Hi,



    About three months ago my VB function using gmail to send email stopped working. I get the following error: "Run-time error '2147220973 (80040213)' The transport failed to connect to the server."

    I've tried to the following with no success:

    -Turning off antivirus/firewall
    -Change send and from email addresses
    -Use a different outgoing port (I've tested the ports using telnet and all is working fine)

    Fyi, my system is Win 7 64 bit. Any help would be greatly appreciated.

    My vb code is as follows:

    Code:
    Public Sub GmailSend()
      Dim cdomsg
      Set cdomsg = CreateObject("CDO.message")
      With cdomsg.Configuration.Fields
        .Item("http://schemas.microsoft.com/cdo/con...tion/sendusing") = 2 'NTLM method
        .Item("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = "smtp.gmail.com"
        .Item("http://schemas.microsoft.com/cdo/con...smptserverport") = 587 '995, 465, 587
        .Item("http://schemas.microsoft.com/cdo/con...ion/smtpusessl") = 1
        .Item("http://schemas.microsoft.com/cdo/con...tpauthenticate") = 1
        .Item("http://schemas.microsoft.com/cdo/con...nectiontimeout") = 30
        .Item("http://schemas.microsoft.com/cdo/con...n/sendusername") = "(full sender email address)"
        .Item("http://schemas.microsoft.com/cdo/con...n/sendpassword") = "(full sender password)"
        .Update
      End With
      ' build email parts
      With cdomsg
        .To = "(full recipient email address)"
        .From = "(full sender email address)"
        .Subject = "subject"
        .Addattachment "c:\temp\test.xls"
        .TextBody = "body text"
        .Send
      End With
    
      Set cdomsg = Nothing
    End Sub

  2. #2
    slam19s is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    2
    For anyone that was following this, I was not able to figure out what happened that caused the code to stop working. However, I did find a separate code on utteraccess which worked.

    Code:
    Public Sub GmailSend()
    Dim iMsg As Object
    Dim iConf As Object
    Dim Flds As Variant
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    iConf.Load -1 ' CDO Source Defaults
    Set Flds = iConf.Fields
    With Flds
    .Item("http://schemas.microsoft.com/cdo/con...tpauthenticate") = 1
    .Item("http://schemas.microsoft.com/cdo/con...n/sendusername") = "(full sender email address)"
    .Item("http://schemas.microsoft.com/cdo/con...n/sendpassword") = "(full sender password)"
    .Item("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = "smtp.gmail.com"
    .Item("http://schemas.microsoft.com/cdo/con...tion/sendusing") = 2
    .Item("http://schemas.microsoft.com/cdo/con...smtpserverport") = 465 'NOT 25 OR 587 'Use SSL for the connection (False or True)
    .Item("http://schemas.microsoft.com/cdo/con...ion/smtpusessl") = True
    .Update
    End With
    
    With iMsg
    Set .Configuration = iConf
    .To = "(recipient email address)"
    .CC = ""
    .BCC = ""
    .From = "(sender email address)"
    .Addattachment "c:\temp\test.xls"
    .Subject = "subject text"
    .TextBody = "body text"
    .Send
    End With
    End Sub

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Thanks for posting back with the solution. Welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Action Failed: Error Number: 2950
    By keen1598 in forum Reports
    Replies: 5
    Last Post: 03-29-2013, 03:20 PM
  2. Print button no longer working
    By kris335 in forum Programming
    Replies: 6
    Last Post: 09-28-2012, 08:56 PM
  3. ODBC -- Call Failed error
    By Coffee in forum Access
    Replies: 3
    Last Post: 07-08-2011, 10:34 AM
  4. Help: ODBC call failed -952 SQLSTATE 57014 error
    By accessnewbie in forum Access
    Replies: 2
    Last Post: 02-02-2011, 01:01 PM
  5. Action Failed -Error Number: 2950
    By Cindy in forum Access
    Replies: 5
    Last Post: 07-07-2010, 11:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums