title: Error code 80040217 when using Outlook 365 with CDO
body: <p>I have been using CDO from my access application successfully for some time. We are now moving to Office (and Outlook) 365. My CDO code now doesn't work and gives a transport error 80040217.  I have read that this error has to do with username and password authentication. According to our server admin I have the right information.</p>
  
  <p>I have seen conflicting articles as to whether or not CDO can be used with 365. I have also tried the different port numbers (25 seems to be the right one). I also have seen older articles saying the server should be a pod id like podxxxxx.outlook.com, but then other articles say that is old and to just use smtp.office365.com. </p>
  
  <p>I have no idea how to get the pod information if that is what I need.</p>
  
  <p>I have attached the code I am using, but I was wondering if anyone knows whether CDO really does or does not work with 365. If it does, is there some setting we may be missing on our server? Our admin has sent an email with this address through the command line, so it appears the userid is good, but he used Base 64 encoding for the username and password. I tried that but it didn't work either. </p>
  
  <p>I have also tried using the MX endpoint for the smtpserver value like myaddress-com.mail.protection.outlook.com and I still get the error. </p>
  
  <p>Any suggestions?</p>
  
  <pre><code>Dim cdoConfig As Object, objMessage As Object
  
  Set cdoConfig = CreateObject("CDO.Configuration")
  With cdoConfig.Fields
      .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
      .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.office365.com"   
      .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
      .Item("http://schemas.microsoft.com/cdo/configuration/username")="donotreply@myaddress.com"
      .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")="passwordhere"
      .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")= 1
      .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")=True
      .Update
  End With
  
  Set objMessage = CreateObject("CDO.Message")
  Set objMessage.configuration = cdoConfig
  objMessage.To = "someone@myaddress.com"
  objMessage.FROM = "donotreply@myaddress.com"
  objMessage.Subject = "test"
  objMessage.textBody = "put the body here"
  objMessage.Send
  </code></pre>