View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vacuum Sealed Vacuum Sealed is offline
external usenet poster
 
Posts: 259
Default Sending mail from Excel with CDO by Ron de Bruin

On 29/09/2011 10:49 PM, Mumbai WH wrote:
It seems that my 1st post is not appearing in group so posting again.

I am using CDO code for sending mail from excel given by Ron de Bruin
at
http://www.rondebruin.nl/cdo.htm
1st code on page.

I am getting error as below.

Microsoft Visual Basic
Run-time error '-2147220973 (80040213)’:
The transport failed to connect to the server.

using Excel 2007 and outlook 2007.

Pl help.

Regards,
Madiya



Madiya

did you read this section:

Read this!!!

This code will not work in Win 98 and ME.
You must be connected to the internet when you run a example.

It is possible that you get a Send error when you use one of the examples.
AFAIK : This will happen if you haven't setup an account in Outlook
Express or Windows Mail.
In that case the system doesn't know the name of your SMTP server.
If this happens you can use the commented green lines in each example.
Don't forget to fill in the SMTP server name in each code sample where
it says "Fill in your SMTP server here"

When you also get the Authentication Required Error you can add this
three lines.
..Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"username"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"password"

Don't remove the TextBody line in the code. If you do you can't open
the attachment (bug in CDO).
If you don't want to have text in the body use this then .TextBody = ""

Note: It is always possible that your firewall block the code (Check
your firewall settings)


As you have not posted the actual code you are using and any references
it is difficult to pinpoint the problem.

HTH
Mick.