title: Error '80040211' Using CDO.Message to send emails on Windows Server 2012 R2
body: <p>Using the following same VBScript/ASP files, I can only manage to send out the email on a Win7 PC. When running the same script on a Windows Server 2012&nbsp;R2, with all the firewalls turned off, I was unable to send out the email. There is a McAfee virus scanner but even when I disable it, I was also unable to send the email out. I have also set the <code>Allow less secure apps: ON</code> on the Gmail account and I still get the <code>error on '80040211'</code> Please help me as I run out of ideas to troubleshoot.</p>
  
  <pre><code>Dim ObjSendMail
  
  Set ObjSendMail = CreateObject("CDO.Message")
  
  ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
  ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
  ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = "True"
  ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
  ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
  ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "****@gmail.com"
  ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "*****"
  ObjSendMail.Configuration.Fields.Update
  
  ObjSendMail.Subject = "Testing Send Email"
  ObjSendMail.From = "****@gmail.com"
  ObjSendMail.To = "hello123@gmail.com"
  ObjSendMail.HTMLBody = "Send mail successful"
  ObjSendMail.Send
  
  Set ObjSendMail = Nothing
  
  response.Write "Email Sent Successfully"
  </code></pre>
  
  <h1>After setting up telnet, I typed telnet smtp.gmail.com 587 and I get the following response:</h1>
  
  <p><a href="https://i.stack.imgur.com/d0glu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d0glu.png" alt="Pic"></a></p>