title: Using CDO.Message in VBscript - can't send binary attachment
body: <p>Sending an email with a text file attached, this works (test email is received):</p>
  
  <pre><code>Set emailObj = CreateObject("CDO.Message")
  emailObj.From = "sender@domain.tld"
  emailObj.To = "recipient@domain.tld"
  emailObj.Subject = "File attached" 
  emailObj.TextBody = "Please have a look at the attached file. Thanks."
  emailObj.AddAttachment "d:\temp\test.txt"
  
  Set emailConfig = emailObj.Configuration
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "server.webhost.com"
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2  
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1  
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true 
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "sender@domain.tld"
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "top_secret"
  emailConfig.Fields.Update
  
  emailObj.Send
  
  If err.number = 0 then Msgbox "Your file has been sent. Someone will respond as soon as possible."
  </code></pre>
  
  <p>But when I try to send a binary file, this does NOT work (test email message is not received):</p>
  
  <pre><code>Set emailObj = CreateObject("CDO.Message")
  emailObj.From = "sender@domain.tld"
  emailObj.To = "recipient@domain.tld"
  emailObj.Subject = "File attached" 
  emailObj.TextBody = "Please have a look at the attached file. Thanks."
  emailObj.AddAttachment "d:\temp\test.rtf"
  
  Set emailConfig = emailObj.Configuration
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "server.webhost.com"
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2  
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1  
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true 
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "sender@domain.tld"
  emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "top_secret"
  emailConfig.Fields.Update
  
  emailObj.Send
  
  If err.number = 0 then Msgbox "Your file has been sent. Someone will respond as soon as possible."
  </code></pre>
  
  <p>What do I need to add/change to be able to attach a binary file?</p>