title: Classic ASP, Sending E-mail on windows server 2008 - error '8004020f'
body: <p>I am trying to send e-mail with classic ASP (I am stuck with an old app so I have to use classic ASP here) on Windows Server 2008 R2, IIS 7.5.</p>
  
  <p>I guess lots of thing change from win server 2003 to 2008. I am using the following code but I am getting this error (BTW, error message is so "informative");</p>
  
  <blockquote>
    <p>error '8004020f'</p>
    
    <p>/poo.asp, line 32</p>
  </blockquote>
  
  <p>Here is the code;</p>
  
  <pre><code>&lt;!-- 
      METADATA 
      TYPE="typelib" 
      UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"  
      NAME="CDO for Windows 2000 Library" 
  --&gt;  
  &lt;%  
  
      'Declare variables 
      Dim sch, cdoConfig, cdoMessage
      sch = "http://schemas.microsoft.com/cdo/configuration/" 
  
      Set cdoConfig = CreateObject("CDO.Configuration")  
  
      With cdoConfig.Fields  
          .Item(cdoSendUsingMethod) = cdoSendUsingPort  
          .Item(cdoSMTPServer) = "mail.example.com"
          'Set SMTP port which is 25 by default 
          .Item(sch &amp; "smtpserverport") = 587 
          .Update  
      End With 
  
      Set cdoMessage = CreateObject("CDO.Message")  
  
      With cdoMessage 
          Set .Configuration = cdoConfig 
          .From = "info@example.com" 
          .To = "me@example2.com" 
          .Subject = "Sample CDO Message" 
          .TextBody = "This is a test for CDO.message" 
          .Send 
      End With 
  
      Set cdoMessage = Nothing  
      Set cdoConfig = Nothing  
  
  Response.write "&lt;HTML&gt;&lt;head&gt;&lt;title&gt;A message has been sent.&lt;/title&gt;&lt;/head&gt;&lt;body&gt;A message has been sent.&lt;/body&gt;&lt;/HTML&gt;"
  
  %&gt;
  </code></pre>
  
  <p>Also, I just installed <strong>Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1</strong> from <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=1004" rel="nofollow">http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=1004</a> into my server but it didn't change anything. </p>
  
  <p><strong>NOTE:</strong> I could send e-mail over localhost if it works. doesn't matter.</p>