Solved

cdosys - now not working in Windows2008 after working

Posted on 2012-03-28
12
651 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
[X]
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
  • 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

Question has a verified solution.

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

Suggested Solutions

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…

749 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