I am trying to send an email with classic ASP (I am stuck with an old application, so I need to use classic ASP here) on Windows Server 2008 R2, IIS 7.5.
I think a lot has changed from Win Server 2003 to 2008. I use the following code, but I get this error (BTW, the error message is so "informative");
error '8004020f'
/poo.asp line 32
Here is the code:
<!-- METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows 2000 Library" --> <% '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 & "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 "<HTML><head><title>A message has been sent.</title></head><body>A message has been sent.</body></HTML>" %>
In addition, I just installed the Microsoft Exchange Server MAPI Client and collaboration data objects 1.2.1 from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=1004 on my server, but nothing has changed.
NOTE. I can send email through localhost if it works. irrelevant.
source share