title: CDO.Message Classic ASP - Adding attachment
body: <p>I am having problems trying to add an attachment to an email using Classic ASP. I have trawled forums and it seems I needed to add .AddAttachment = "c:\users\samplb\logoblack.gif" but the form doesn't work anymore. It comes up with the "The website cannot display the page" message.</p>
  
  <p>Here is my Code:</p>
  
  <pre><code>&lt;% 
  
  name = request.form("name")
  Message = request.form("Message")
  
  
  Set cdoConfig = CreateObject("CDO.Configuration")  
  
  With cdoConfig.Fields  
      .Item(cdoSendUsingMethod) = cdoSendUsingPort  
      .Item(cdoSMTPServer) = "xxx"  
      .Update  
  End With 
  
  Set cdoMessage = CreateObject("CDO.Message")  
  
  With cdoMessage 
      Set .Configuration = cdoConfig 
      .From = "test@me.co.uk"
      .To = "test@me.co.uk" 
      .Subject = "Feedback / Suggestions" 
      .AddAttachment = "c:\users\samplb\logoblack.gif" 
      .TextBody = "Name: " &amp; name &amp; vbcrlf &amp; vbcrlf &amp; "Message: " &amp; Message  
      .Send 
  End With 
  
  Set cdoMessage = Nothing  
  Set cdoConfig = Nothing  
  %&gt;
  </code></pre>
  
  <p>Does anyone know why it might not be working? When I take the .AddAttachment out the form works fine but I really need it to send the attachment.</p>