Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

cdosys - now not working in Windows2008 after working

Posted on 2012-03-28
12
647 Views
Last Modified: 2012-08-14
I had email working out of Windows 2008 - now the simple code below is no longer working - gets error message on the send statement:
<%  
Set objEmail=CreateObject("CDO.Message")
objEmail.From="dc@xxxxxxx.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") = "127.0.0.1"
            objEmail.Configuration.Fields.Item _
             ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
            objEmail.Configuration.Fields.Update
              objEmail.Send
%>
The only reason I know it's on the send statement is that it runs without an error until I put that line in the code.
I had smtp set up to go out without authentication, then noticed hackers using it.
Now, I need to figure out why smtp stopped working with no changes being made, and then I need to figure out how to send with either basic authentication or Windows authentication.  Basic asks for a domain instead of a password.  Windows won't let me select Authenticated Users - it's not in the list.  Plus I need the configuration.fields.item statement for either or both.
Apparently, everyone in the world can use my smtp but me!
0
Comment
Question by:dcass
  • 6
  • 6
12 Comments
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37778366
what error exacly are you getting?
0
 

Author Comment

by:dcass
ID: 37778374
It is a 64 bit system.  I uninstalled and reinstalled cdosys.dll on both with regsrv32.
Someone mentioned setting up a 32 bit application pool, but I'm not sure how to do that.
Corrected code (still error on send statement):
<%  
Set objEmail=CreateObject("CDO.Message")
objEmail.From="dc@xxxxxxx.com"
objEmail.Subject = "test"
objEmail.textBody = "test"
objEmail.To="dc@xxxxxx.com"
               
            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
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37778390
What version of iis?

If iis6, then run this on command line prompt as is and it will enable 32bit mode.

cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 “true”

sorry pushed the button too soon.

For iis, try this:

Below is how you do it from IIS7 manager:

Right click on the Application Pool and select “Advanced Settings…” or select the same from the Actions pane after selecting the Application pool
Change the “Enable 32-bit Applications” to True (if you want the application pool to spawn in a 32-bit mode)
Click OK

or commandline use this:

appcmd set apppool /apppool.name:MyAppPool32bit /enable32BitAppOnWin64:true
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:dcass
ID: 37778455
cmd didn't work - running it on DOS at C:\ prompt, right?
0
 

Author Comment

by:dcass
ID: 37778460
smtp does run on IIS6 on 2008.
iis runs of IIS7
0
 
LVL 28

Accepted Solution

by:
sammySeltzer earned 500 total points
ID: 37778479
Sorry, I missed that it is windows 2008 .

Well, you don't have to do it using command prompt.

Just follow this:

Right click on the Application Pool and select “Advanced Settings…” or select the same from the Actions pane after selecting the Application pool
Change the “Enable 32-bit Applications” to True (if you want the application pool to spawn in a 32-bit mode)
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37778488
This is actually more intuitive.

http://www.winservermart.com/HowTo/How_To_Switch_32bit_and_64bit_mode_in_IIS7.aspx

Hopefully, that's your issue.

Our classic asp app runs on windows server 2008 with emails going out every 2 days with no problems at all.
0
 

Author Comment

by:dcass
ID: 37778902
Did that and found that someone outside sent out 120,000 emails that were going out, but I still can't send one out.  Took a while to clear all that out.
I still get an error on the send statement.
Can you send me a code example?
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37779013
It is still not very clear to me how a hacker hacked into your email.

But here is the code we use.

Notice that we used Anonymous authentication.

          <!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
          NAME="CDO for Windows XP Library" -->
      <%

	'code for sending email.  This will one work on windows windows xp or higher
	Dim iMsg
	Set iMsg = CreateObject("CDO.Message")
	Dim iBp
	Dim Flds
	Dim iConf
	Set iConf = CreateObject("CDO.Configuration")
	Set Flds = iConf.Fields
	Flds(cdoSendUsingMethod)  = cdoSendUsingPort
	Flds(cdoSMTPServer)       = "servername"
	Flds(cdoSMTPServerPort)   = 25
	Flds(cdoSMTPAuthenticate)     = cdoAnonymous ' 0
	Flds.Update
	With iMsg
	 Set .Configuration = iConf
	     .From = ""&firstname&"" & ""&lastname&"" & "<" & email & ">"
	     .To = "sales@doamin.com"
	     .Subject     = "Employment Application"
	     .TextBody    = "First Name = "& fName &""& VbCrLf & "Last Name = "& lName &""& VbCrLf &"Address = "& Address &"" & VbCrLf & "City = "& City &""& VbCrLf & "State = "& state &" "& VbCrLf & "Zip Code = "& zip &""& VbCrLf &"Phone = "& phone &"" & VbCrLf & "Email = "& Email &" "& VbCrLf & "Position = "& position &""& VbCrLf & "Start Date = "& sDate &""& VbCrLf &"Applied Here Before? = "& appliedHere &""& VbCrLf & "What you like Most about this place = "& likeMost &" "& VbCrLf &""
		 .Send
	End With
		if Err.number > 0 then
			mailMerchant = false
		else
			mailMerchant = true
		end if
		mailMerchant = false
%>

Open in new window

0
 

Author Comment

by:dcass
ID: 37779226
Email is going out now - I do believe enabling 32 bit on IIS Application pool was the key.  I do not know how I got some to go out last week without this.  I really hope this is the end of this - it's two days wasted so far and I don't even have PHP or Wordpress installed - I already hate Windows 2008, but I'm stuck with it for now.

I didn't have to make any code changes at all.

I've also closed the ports, so now there is no more hacking in.
0
 

Author Closing Comment

by:dcass
ID: 37779230
Finally someone who knew the answer!
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37779673
Glad you sorted things out.

Remember that php works with iis as well as apache.

So, if you decided to go that now, let us know.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello Friends, My friends and relatives always ask me how to delete all the various types of emails at once in our g-mail  or windows live account.  So I researched this topic to find a unique solution to this query.  Here it is for those who do …
What is Usenet? There are many different opinions on exactly what Usenet is an isn't. Many opinions are incorrect simply out of ignorance. The Wikipedia listing about Usenet does a good job of explaining it, so instead of repeating it all here I wi…
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question