View Full Version : Outlook CDO from home
June7
02-02-2025, 06:40 PM
I have been attempting to use CDO to send email. I can get this to work with GMail (had to create an app password in Google account and activate 2-factor authentication because it is a personal account).
None of the example code I've found will work for Outlook and my live.com email. I don't subscribe to Office 365 and not a business environment, just me at home. Seems this worked years ago with "smtp-mail.outlook.com" as the smtpserver but maybe that was at work before I retired. Is there any way to use CDO with outlook from home network?
Aussiebear
02-02-2025, 07:38 PM
Gemini has the following:
Collaboration Data Objects (CDO) is a Microsoft library that allows you to work with email and other messaging data. While it can be used with Outlook, there are some limitations and considerations when using it from a home network.
Here's a breakdown of the key aspects:
1. CDO and Outlook Versions:
Compatibility: CDO 1.2.1 is not supported with Outlook 2010 and later versions. This is a crucial factor to consider. If you have a newer version of Outlook, CDO might not function as expected.
Alternatives: If you're using a newer Outlook version, you might need to explore alternative methods for working with email programmatically, such as using the Outlook Object Model or Microsoft Graph API.
2. SMTP Client Submission Requirements:
Authentication: You'll need to configure a username and password for your email account to send emails.
Mailbox: You must have a valid and licensed Office 365 mailbox to send emails from.
Transport Layer Security (TLS): Your system needs to support TLS version 1.0 or above for secure communication.
Port: Port 587 (recommended) or port 25 needs to be open and not blocked by your network firewall or Internet Service Provider (ISP).
3. Home Network Considerations:
Firewall: Ensure that your home network's firewall is not blocking the necessary ports (587 or 25) for SMTP communication.
ISP Restrictions: Some ISPs might block certain ports, especially port 25, to prevent spam. You might need to contact your ISP to check if there are any restrictions.
Dynamic IP Address: If you have a dynamic IP address, it might change periodically, which could affect the configuration of your CDO application.
4. Configuration:
SMTP Server Settings: You'll need to obtain the correct SMTP server settings for your email account, including the server address, port number, and encryption method.
Authentication Details: Provide the correct username and password for your email account.
5. Troubleshooting:
Error Messages: Pay close attention to any error messages you encounter, as they can provide clues about the issue.
Testing: Test your CDO application thoroughly to ensure that it's sending emails correctly.
Documentation: Refer to the official Microsoft documentation and online resources for troubleshooting tips and solutions.
Important Notes:
Security: Be cautious when handling email credentials and ensure that your code is secure to prevent unauthorized access.
Alternatives: Consider exploring alternative methods for working with email programmatically, as CDO might have limitations with newer Outlook versions and security considerations.
Recommendations:
Check Outlook Version: Verify the version of Outlook you're using to ensure compatibility with CDO.
Review SMTP Requirements: Make sure you meet all the SMTP client submission requirements.
Configure Firewall and ISP: Check your firewall settings and contact your ISP to ensure that the necessary ports are open.
Explore Alternatives: If CDO is not suitable for your needs, consider using the Outlook Object Model or Microsoft Graph API as alternatives.
Remember to consult the official Microsoft documentation and online resources for detailed instructions and troubleshooting assistance.
June7
02-02-2025, 10:02 PM
I have Office 2010 and 2021. The Microsoft CDO for Windows 2000 Library is still there.
I do not have Office365.
CDO with GMail server works.
So I guess I will consider Outlook a deadend and abandon.
Gasman
02-03-2025, 04:08 PM
I have Office 2010 and 2021. The Microsoft CDO for Windows 2000 Library is still there.
I do not have Office365.
CDO with GMail server works.
So I guess I will consider Outlook a deadend and abandon.
You *might* have migrated to Outlook New which does not support COM?
There is a registry entry you can add to stop New taking over, after why would you, if you have code like I have to send emails from Access for example.
As for CDO Colin has a test app you can use to test your connection. However as you must be aware CDO is just for sending?
https://isladogs.co.uk/email-tester/index.html
June7
02-03-2025, 08:53 PM
No, I use old Outlook.
I already tried Colin's app.
Yes, for sending.
Not something I really need in my life. Just annoyed that I can get GMail to work but not Outlook. I am NOT subscribing to Office365 - never, never, never.
Gasman
02-04-2025, 02:55 AM
June7,
From this link https://www.google.com/search?q=live.com+and+cdo&oq=live.com+and+cdo&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIICAEQABgWGB4yCAgCEAAYFhgeMggIAxAAGBYYHjIKCAQ QABiABBiiBDIKCAUQABiiBBiJBTIHCAYQABjvBTIKCAcQABiABBiiBDIHCAgQABjvBdIBCDY1Mj dqMGo0qAIAsAIA&sourceid=chrome&ie=UTF-8,
I got this
https://answers.microsoft.com/en-us/outlook_com/forum/all/use-cdo-to-send-emails-via-outlookcom/93a94800-2084-47ab-b600-ebff46388647
and their issue was the port number?
June7
02-04-2025, 10:57 AM
Yet some sources say port 587. Already tried port 25. Same error message: The "SendUsing" configuration value is invalid.
Every code example I find shows 2 as the parameter to use:
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Gasman
02-04-2025, 12:16 PM
Well for SSL/TLS I would expect 587 or 465?
June7
02-04-2025, 05:26 PM
Port number is determined by:
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587 ' also tried 25
Gasman
02-05-2025, 02:30 AM
I have an outlook.com address.
If you want to send me a DB with working code, I will try at my end, if that helps at all?
June7
02-05-2025, 11:06 AM
You mean code that works for GMail? Use Colins app from the link in post 4.
When I try it for Outlook, I get "The transport failed to connect to the server."
If I change the sendusing method to 1 - local, I get "The pickup directory path is required and was not specified." I don't know what that is.
With simplified code in my db I get "The "SendUsing" configuration value is invalid"
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.