cdosys - not working in Windows2008

Not using Exchange, just sending out emails from CDOSYS.
We moved from a Windows server 2003 to 2008 and now none of my email code works - using CDOSYS - nothing fancy.
SMTP installed an running - I know to look on IIS 6.
I Set the web site on IIS7 to use localhost.
Port's open.
No error messages in event viewer.
Detail Error message when running asp program:
An error occurred on the server when processing the URL. Please contact the system administrator.

If you are the system administrator please click here to find out more about this error.

and when I click here, it has absolutely nothing about anything relevant to the situation at all.
dcassAsked:
Who is Participating?
 
dcassAuthor Commented:
Now working perfectly - changed the code to use 127.0.0.1 instead of localhost.
Reset IIS6 to much shorter retry times (1 minute).
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "dc@xxxxxxxxxx.com"
objEmail.To = "dc@cxxxxxxxxxx.com;9999999999@email.uscc.net"
objEmail.textbody = "test"
objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1"
objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
0
 
Dave BaldwinFixer of ProblemsCommented:
This works on my Godaddy IIS7 account.  I found it somewhere and adapted it.

<%@ LANGUAGE = VBScript %>
<%  Option Explicit		%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>CDO-Email</title>
</head>
<body>
<h1>CDO-Email</h1>
<p>Godaddy demo code.</p>
<%
Dim sendUrl, smtpUrl, objConfig, objMail

sendUrl="http://schemas.microsoft.com/cdo/configuration/sendusing"
smtpUrl="http://schemas.microsoft.com/cdo/configuration/smtpserver"

' Set the mail server configuration
Set objConfig=CreateObject("CDO.Configuration")
objConfig.Fields.Item(sendUrl)=2 ' cdoSendUsingPort
objConfig.Fields.Item(smtpUrl)="youremailhost.com"
objConfig.Fields.Update

' Create and send the mail
Set objMail=CreateObject("CDO.Message")
' Use the config object created above
Set objMail.Configuration=objConfig
objMail.From="youremail@host.net"
objMail.ReplyTo="youremail@host.net"
objMail.To="theiremail@host.com"
objMail.Subject="This are the subject"
objMail.TextBody="And this are the bodybody."
objMail.Send
%> 
</body>
</html>

Open in new window

0
 
dcassAuthor Commented:
What does Godaddy have to do with localhost smtp?
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
Dave BaldwinFixer of ProblemsCommented:
The point of my post was that CDOSYS does work with IIS7.  If you would post the basic version of your code that doesn't work, maybe somebody could help you.
0
 
dcassAuthor Commented:
Do you mean to use "localhost" instead of "youremailhost.com"?
0
 
dcassAuthor Commented:
It doesn't work anyway - I'm missing something in the setup or something else - the code I have works, just not on this system.
CDOSYS.dll is installed - I checked.
0
 
dcassAuthor Commented:
Set myMail=CreateObject("CDO.Message")
    myMail.Subject="This is an email"
    myMail.From="mailbox@yourdomain.com"
    myMail.To="xx@xxxx.com"
    myMail.TextBody="Hello"
    myMail.Send
0
 
Dave BaldwinFixer of ProblemsCommented:
You can try that.  One of the things that comes up with Windows 7 and possibly Server 2008 is that localhost is defined as an IPV6 address of '::1' instead of the IPV4 address of '127.0.0.1'.  If localhost doesn't work, try '127.0.0.1'.

Here http://forums.iis.net/t/1144383.aspx is a discussion of getting CDOSYS to work on IIS7 with some sample code.  And someone else said this http://forums.iis.net/p/1157046/1901343.aspx got it working for them on localhost.

5. in IIS7,  go to website/virtual directory, double click "SMTP E-mail", Click on "Deliver e-mail to SMTP server", check the "Use localhost" checkmark
0
 
dcassAuthor Commented:
Unfortunately neither of the links work.

Did this already:
5. in IIS7,  go to website/virtual directory, double click "SMTP E-mail", Click on "Deliver e-mail to SMTP server", check the "Use localhost" checkmark
0
 
dcassAuthor Commented:
Plus I'm not using aspx - just plain asp.
0
 
dcassAuthor Commented:
Also, I know ASP is installed and working properly.
SMTP is also installed and shows active.
Error occurs as soon as I try to create the object.
0
 
Dave BaldwinFixer of ProblemsCommented:
You've exhausted what little I know.  If you click on "Request Attention" above, you can get some others to look at your question.  It's late on Friday night and into Saturday morning here so it may take a while.
0
 
dcassAuthor Commented:
I don't have that button - maybe you can for me?
0
 
dcassAuthor Commented:
Also, the error occurs from the mymail.send - not the object creation.
I am new to windows 2008 - can't find any error msg in any log.
0
 
Dave BaldwinFixer of ProblemsCommented:
I ran into that error on another sample code on IIS7 because it didn't have the configuration section that comes first in my sample code above.  The code you posted above works fine on my Windows XP IIS 5.1 with SMTP.  It must be a standard demo somewhere.  But it's not good for IIS7 for some reason.
0
 
dcassAuthor Commented:
The configuration section gives an error - does that give you any clues?
Again, I can't find the exact error - don't know where to look - Event Viewer doesn't seem to have any errors that pertain to this.
0
 
dcassAuthor Commented:
One weird thing, on IIS on the web site, under ASP.NET it has SMTP E-mail, but it doesn't have it under IIS/ASP.
I've set up the SMTP E-Mail under ASP.NET - checked Deliver e-mail to SMTP server, but again I'm not sending it out via asp.net.
0
 
dcassAuthor Commented:
OK: this works for email but will not send out a text message, which I hope you know that is an email, so I'm very confused.
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "xx@xxxx.com"
objEmail.To = "xx@xxxx.com"
objEmail.Subject = "test"
objEmail.textbody = "test"
objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send

but does NOT work for (which does work on Windows 2003):
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "xx@xxxx.com"
objEmail.To = "9999999999@email.uscc.net"
objEmail.Subject = "test"
objEmail.textbody = "test"
objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
0
 
dcassAuthor Commented:
Here is the actual email - I'm thinking since it's going out from the server, it must be some kind of mismatch here for the cell phone companies not to deliver (of course I've replaced real numbers  for security purposes):

Received: (qmail 19367 invoked from network); 24 Mar 2012 16:25:43 -0000
Received: from unknown (HELO p3pismtp01-018.prod.phx3.secureserver.net) ([10.6.12.18])
          (envelope-sender <9999999999@email.uscc.net>)
          by p3plsmtp02-06.prod.phx3.secureserver.net (qmail-1.03) with SMTP
          for <9999999999@email.uscc.net>; 24 Mar 2012 16:25:43 -0000
X-IronPort-Anti-Spam-Result: ArAFAJD0bU9EWkXSTmdsb2JhbABDikSsdIEJAQEiS4IFBgUIKB0NLAUGJCQ0EAgGAgIDAQQbhUCCMBKdNpgFjgSCQWMEiFegOw
Received: from colo2-xxxxxxxxx-210.epconline.net (HELO CWEB) ([99.99.99.999])
  by p3pismtp01-018.prod.phx3.secureserver.net with ESMTP; 24 Mar 2012 09:25:12 -0700
Received: from CWEB ([127.0.0.1]) by CWEB with Microsoft SMTPSVC(7.5.7601.99999);
         Sat, 24 Mar 2012 11:25:12 -0500
thread-index: Ac0J2rAoOnkFdUNjTqqVyHedXZFHkw==
From: <9999999999@email.uscc.net>
To: <9999999999@email.uscc.net>
Date: Sat, 24 Mar 2012 11:25:12 -0500
Message-ID: <75439D3051F94A429998A0F91DAB6F28@CWEB>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7601.17609
Return-Path: 9999999999@email.uscc.net
X-OriginalArrivalTime: 24 Mar 2012 16:25:12.0655 (UTC) FILETIME=[B02815F0:01CD09DA]
X-Nonspam: None

test
0
 
Dave BaldwinFixer of ProblemsCommented:
Can you send a regular email from another account like your Gmail account to <9999999999@email.uscc.net>?
0
 
Dave BaldwinFixer of ProblemsCommented:
And can you use that code to send to a regular email account instead of a cell phone account?
0
 
dcassAuthor Commented:
Yes and yes.
I've read articles now about how 2008  is doing this on purpose - making it difficult to impossible to send out email and I guess the protocols are not right for cell phones.
It looks like I'll have to start all over and install Windows 2003.
I sure would like to find out if 2005 has the same problems, but I won't have time to do this kind of research all over again.  
Anyone know about 2005?
0
 
dcassAuthor Commented:
Good news - text messaging came through about 10-12 hours after sent.
They had "Delay" on them - is there a setting to not delay?
0
 
Dave BaldwinFixer of ProblemsCommented:
Thanks, glad you got it working.
0
 
dcassAuthor Commented:
The last post is the final correct post.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.