LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default CDO email - transport failed to connect the server

Hi,

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

Code:
Public Sub email()
On Error Resume Next
Dim objEmail, toemail, schema

schema = "http://schemas.microsoft.com/cdo/configuration/"
Set objEmail = CreateObject("CDO.Message")
With objEmail
.From = "
.To = "
.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
End With

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect to SQL Server Johnslg Excel Programming 0 May 29th 08 01:56 PM
Connect to OPC / DDE server Critcho Excel Worksheet Functions 0 December 6th 07 02:18 AM
How can I use VBA to connect to a SQL server? Bed Guy Excel Programming 1 May 29th 07 10:25 PM
connect to an oracle server Bill Li Excel Programming 0 August 14th 03 04:31 AM


All times are GMT +1. The time now is 08:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"