title: Classic ASP - Sending Email To Own Domain with CDOSYS fails
body: <p>I have a classic asp email script that uses authenticated CDOSYS to send to emails from a database. It's running on a Parallels Plesk Windows 2008 server.</p>
  
  <p>This works fine for all email addresses except for any addresses that belong to sites on the server I am sending from.</p>
  
  <p>I could authenticate using a Google Apps email account (the domain is set up using Google Apps for email) BUT I would run up against Google' 24 hour sending limits each time the client ran the script.</p>
  
  <p>Can anyone point out where I'm going wrong or explain why email to sites on the sending server causes an error? The error is </p>
  
  <pre><code>error '8004020f'
  /admin/send-group-email.asp, line 128
  </code></pre>
  
  <p>which is the objCDO.Send line</p>
  
  <p><strong>The Code :</strong> </p>
  
  <p>(primarydomain.com is the domain name of the primary account the site lives under in Parallels. The SenderEmail value would be, for example,  id@secondarydomain.com)</p>
  
  <pre><code>Set cdoConfig = CreateObject("CDO.Configuration")  
  
      With cdoConfig.Fields  
          .Item(cdoSendUsingMethod) = cdoSendUsingPort  
          .Item(cdoSMTPServer) = "localhost"  
          .Item(cdoSMTPAuthenticate) = 1  
          .Item(cdoSendUsername) = "authenticate@primarydomain.com"  
          .Item(cdoSendPassword) = "thepassword"  
          .Update  
      End With 
  
     while (NOT RS_Emails.EOF)
        Dim objCDO      
        set objCDO = Server.CreateObject("CDO.Message")
        objCDO.Configuration = cdoConfig
        objCDO.From = CStr(Request.Form("SenderEmail")) &amp; " (" &amp; CStr(Request.Form("SenderName")) &amp; ")"
        objCDO.To = RS_Emails.Fields.Item("email").Value
        objCDO.Subject = CStr(Request.Form("Subject"))
        objCDO.HTMLBody = message
        objCDO.Send
        set objCDO = Nothing
        RS_Emails.MoveNext
      Wend
        set cdoConfig=Nothing
  </code></pre>