Error in sending email with CDO (1 Viewer)

dmarop

Registered User.
Local time
Today, 10:35
Joined
May 17, 2013
Messages
41
Hello,

I will need your help for the following.

In Access I am sending emails with CDO and I take this error: Run-time error '2147220975(80040211)':

The code of CDO was running great in windows and access 2007. From the moment I installed windows 2010 and access 2013 it is not working.

I have tried it and with different smtpserver but it stills not working.

Can you help me?

Thank you in advance,

Dimitris
 

isladogs

MVP / VIP
Local time
Today, 08:35
Joined
Jan 14, 2017
Messages
18,207
I believe that this means the user name or password are incorrect

You may find this email tester utility useful - its designed for use with CDO
See this link:
https://www.access-programmers.co.uk/forums/showthread.php?t=293368

Screenshot from the utility help file:

 

Attachments

  • Capture.PNG
    Capture.PNG
    58.8 KB · Views: 3,833

Solo712

Registered User.
Local time
Today, 03:35
Joined
Oct 19, 2012
Messages
829
Hello,

I will need your help for the following.

In Access I am sending emails with CDO and I take this error: Run-time error '2147220975(80040211)':

The code of CDO was running great in windows and access 2007. From the moment I installed windows 2010 and access 2013 it is not working.

I have tried it and with different smtpserver but it stills not working.

Can you help me?

Thank you in advance,

Dimitris

It is more likely a change in one or more transmission parameters than the upgrade of Access. Most often the smtp servers change the receiving port or the mode of transmission. But you should check all of the items below:
Code:
Set cdomsg = CreateObject("CDO.message")
With cdomsg.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'NTLM method
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 587
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.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") = "frommyemail@gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
.Update
End With

Best,
Jiri
 

dmarop

Registered User.
Local time
Today, 10:35
Joined
May 17, 2013
Messages
41
Hello,

Thank you for your answer.

The user name and password are correct.

What may be the problem?

Thank you
 

Solo712

Registered User.
Local time
Today, 03:35
Joined
Oct 19, 2012
Messages
829
Here are some tips for the coding of the cdo fields:
CDO Fields for configuring SMTP Authentication
To configure Message objects, you modify fields in the associated Configuration object. Most of the field names reside in the namespace:
*smtpserver: SMTP server name.
*smtpserverport: SMTP server port (default: 25).
*sendusing: cdoSendUsingPort, value 2, for sending the message using the network, value 1, cboSendUsingPickup, value 3, cboSendUsingExchange
*smtpauthenticate: Specifies the mechanism used when authenticating to an SMTP service over the network. Possible values are:
- cdoAnonymous, value 0. Do not authenticate.
- cdoBasic, value 1. Use basic clear-text authentication. When using this option you have to provide the user name and password through the sendusername and sendpassword fields.
- cdoNTLM, value 2. The current process security context is used to authenticate with the service.
*sendusername: User name
*sendpassword: Password

Best,
Jiri
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 02:35
Joined
Feb 28, 2001
Messages
27,122
My question is whether you have a strict security policy in place. At my site, the firewall knew not only WHO sent a message but WHAT SOFTWARE was used, and the firewall rule needs to know both factors.

If you are in a secured domain, ask your security officer if a firewall rule is being used to control who AND WHAT can send mail. If so, you will need to have another exception added to your firewall rules for the new version of Access - but if this is a shared app and some folks are on older versions of Access, don't remove the old rule.
 

isladogs

MVP / VIP
Local time
Today, 08:35
Joined
Jan 14, 2017
Messages
18,207
Tony
Re negative error numbers, see this post
https://www.access-programmers.co.uk/forums/showpost.php?p=1540269&postcount=4

Dmarop
My utility allows you to test each of the CDO values and check the effect.
It provides a list of the most common error numbers and their causes.
I built the help file info by deliberately setting every possible value incorrectly and checking the output.
Try it. It may help you find the cause or causes.

I also agree with jiri that its likely to be a change in the settings rather than anything to do with Windows/Access version changes
 

Users who are viewing this thread

Top Bottom