Sending mail from Excel with CDO
Hi all
I update my CDO page today.
Code is working now in Excel 97-2007 or 2000-2007.
http://www.rondebruin.nl/cdo.htm
If you have problems let me know.
Ron de Bruin
http://www.rondebruin.nl/tips.htm
Update:
I can’t post comments to this blog because of the new spam filter on this blog that’s why i do it this way.
I add a GMail example to the example workbook on my CDO page today.
Let me know if it is working for you.
doco:
[quote]
26 June 2007, 12:34 amRun-time error '-2147220960(80040220)':
The "SendUsing" configuration value is invalid
[/quote]
najeem:
got the same error......
26 June 2007, 1:05 am'the sendusing configuration value is invalid', though i have outlook configured and runningin my pc..
Ron de Bruin:
Please read the information on my site
*****************************************
It is possible that you get a Send error when you use one of the examples.
26 June 2007, 9:49 amAFAIK : 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"
doco:
Using Outlook, not express
26 June 2007, 9:57 amdoco:
Using Outlook, not express...
26 June 2007, 9:58 amRon de Bruin:
Hi Doco
>Using Outlook, not express...
26 June 2007, 10:24 amThen use the commented code and fill in your SMTP server
sam:
I am using CDO_Mail_Small_Text code in your workbook
I have filled up sendusing as 2, Smtp server as "smtp.gmail.com" and port as 465
It gives me an error Run-time error '-2147220973(8004123)'
"The Transport failed to connect to server"
Regards
5 August 2007, 10:31 pmSam
Srinivas:
Hi ,
I am using CDO_Mail_Small_Text code in your workbook
7 August 2007, 12:23 amI have filled up sendusing as 2, Smtp server as "smtp.gmail.com"
"The Transport failed to connect to server"
Please let me know what to do
Regards
Srinivas
sam:
Ron,
You need to add the below two lines as well.... else it gives the error I mentioned earlier
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xyz@abc.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "abcd"
Regards
17 August 2007, 7:56 amSam
Johnny:
I needed to add this line in order to send via gmail SMTP:
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
I hope this helps others
24 October 2007, 2:14 pmDavid Jenkins:
Hi RondeBruin
Experts exchange pointed me in your direction. Most appreciated. I uncommented the "iconf.load -1 ... end with" area, filled in my SMT server (Put in quotes). When I run it, I get a multitude of errors - the latest is
Run-time error '-2147220978(8004020e)':
Automation error Cannot modify or delete an object that was added usig the COM+ Admin SDK
When I comment out the code previously commented out, I get the following:
Run-time error '-2147220960(80040220)':
Automation error.
I turned off norton - no improvement
Any help you have would be greatly appreciated.
3 February 2008, 9:05 pmRon de Bruin:
If it is at work ask your IT department if they block it
4 February 2008, 10:08 amstapuff:
Ron -
First of all - your code and suggestions have help me a lot. I am trying to use your code to send out an HTML Web Page NewsLetter. The email get's created and the html file get's attached but the links no longer work. I have used a sample mailing list program using the same port, SMTP, etc and the web page links work.
Is there something other than the following that will resolve this?
Or file on your computer
.CreateMHTMLBody "file://C:/test.htm"
Thanks,
Stapuff
20 March 2008, 5:34 pmstapuff:
BTW - I am using Yahoo.
In addition for others - when using Yahoo you need to add the following to Ron's code:
.Item("http://schemas.microsoft.com/cdo/configuration/smtpport") = 465
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
Thanks again,
Stapuff
20 March 2008, 5:37 pmRon de Bruin:
Hi
There is a note about the Port number in the example workbook with the code
'If you get this error : The transport failed to connect to the server
22 March 2008, 2:25 am'then try to change the SMTP port from 25 to 465