Can't send email through SSL server using CDO

smig

Registered User.
Local time
Today, 02:53
Joined
Nov 25, 2009
Messages
2,209
I'm trying to use MS CDO to send emails.
I can do it as long as the server does not require SSL authentication.
Here is the configuration I tried for Gmail
Code:
'With objCDOMessage.Configuration.Fields
'    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2      ' 2 = cdoSendUsingPort, Send the message using the network (SMTP over the network)
'    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
'    .Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 465
'    .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1        ' 1 = cdoBasic, Use basic (clear-text) authentication
'    .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
'    .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
'    .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = MyUserName
'    .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = MyPass
'    .Update
'End With
I tried both prts 465 and 587
I tried both "MyUserName" and "MyUserName@gmail.com"
Nothing worked.

I can send emails if I use a server that does not require SSL
 
I can make it work, but not for ssl. I tried several ssl servers, including gmail
 
You say it does not work. Could you be more specific? For example, is there an error message that you can share with us so that we can help you diagnose the problem?
 

Looked at this site, and still no help :banghead:
Can't make the SSL servers to work :(
Tried both 465 and 587 ports. Tried both smtpusessl = True and smtpusessl = 1 (I know in Access true = -1) settings.

Keep getting error -2147220973 "the transport failed to connect to the server"

I tried against another SSL server - same result :(
No problem with noSSL server
 
Last edited:
I saw some people mentioned that the virus checking software on the PC might be to blame?
 
Well SSL on Gmail is on port 465 or 25 not 45 - that could be an issue.
What happens if you telnet in and issue the mail commands using your settings - that will give you the actual error.
 
Well SSL on Gmail is on port 465 or 25 not 45 - that could be an issue.
What happens if you telnet in and issue the mail commands using your settings - that will give you the actual error.
SSL ports are 465 or 587. I fixed my post.

I'll be happy to try Telnet if I'll know how :D
I'm using Win7 at work and Win10 at home
 
I have also found this on the web which seems to add another account field;
from here http://techsupt.winbatch.com/webcgi...DO/CDO+Send~Email~Using~CDO~SSL~via~GMAIL.txt

Code:
; Note: The following are specific setings for a Gmail Account:
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")         = "smtp.gmail.com"     ; Gmail SMTP server
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")   = 465                  ; Gmail uses port 465
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername")      = "account@gmail.com"  ; Enter your account name here
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")      = "accountpassword"    ; Enter your password here
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpaccountname")   = "account@gmail.com"  ; Enter your account name here
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")         = @TRUE                ; Gmail requires SSL
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")   = 1                    ; nAuthenticate should be Basic Text (1)
 
I have also found this on the web which seems to add another account field;
from here http://techsupt.winbatch.com/webcgi...DO/CDO+Send~Email~Using~CDO~SSL~via~GMAIL.txt

Code:
; Note: The following are specific setings for a Gmail Account:
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")         = "smtp.gmail.com"     ; Gmail SMTP server
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")   = 465                  ; Gmail uses port 465
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername")      = "account@gmail.com"  ; Enter your account name here
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")      = "accountpassword"    ; Enter your password here
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpaccountname")   = "account@gmail.com"  ; Enter your account name here
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")         = @TRUE                ; Gmail requires SSL
;oFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")   = 1                    ; nAuthenticate should be Basic Text (1)
I visited that web page too.
Already added the smtpaccount. No help :(



***Edit***
I tried OstroSoft's SMTP component and it seems to work both for NonSSL and SSL servers
OstroSoft SMTP Component
 
Last edited:
***Edit***
I tried OstroSoft's SMTP component and it seems to work both for NonSSL and SSL servers
OstroSoft SMTP Component

That may indicate a problem with the SSL handling in the CDO method... can you delete and reload the library - or have you tried the routine on another machine ?
 
How can I reload the library ?
Yes, tested on 2 machines. Will do some more tests tomorrow.

I'll might move to osSMTP.
I found it to be much faster


*** Edit ***
osSMTP won't work with Office 64bit :Crying:

so now I'm stuck back to CDO that I can't connect to SSL servers.
For now I have a nonSSL SMTP server I can use with till I find a better solution.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom