Consulting

Results 1 to 2 of 2

Thread: CDO email error - transport failed to connect the server

  1. #1

    CDO email error - transport failed to connect the server

    Hi,

    Please see the following code I am trying to use to send a simple email. I am getting the following error message: Run-time error '-2147220973 (80040213)' The transport failed to connect the server. What could be the problem?

    Dim objEmail, toemail, schema
    schema = "http://schemas.microsoft.com/cdo/configuration/"
    Set objEmail = Create_Object("CDO.Message") 'The space between Create and
    Object is on purpose. Otherwise the text editor of this forum gives an error.
     
    With objEmail
    .From = "ABCD@yahoo.com"
    .To = "XYZ@yahoo.com"
    .Subject = "Test Mail"
    .Textbody = "The quick brown fox " & Chr(10) & "jumps over the lazy dog"
     
    With .Configuration.Fields
    .Item(schema & "sendusing") = 2
    .Item(schema & "smtpserver") = "smtp.mail.yahoo.com"
    .Item(schema & "smtpserverport") = 25
    .Item(schema & "smtpauthenticate") = 1
    .Item(schema & "sendusername") = "ABCD"
    .Item(schema & "sendpassword") = "abcd"
    End With
    .Configuration.Fields.Update
    .Send   'the error is created at this point
    End With
    Thanks,

    MG.

  2. #2
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location
    this looks like something that belongs in the Outlook topic area, not Excel
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

Posting Permissions

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