ASP CDOSYS.DLL Differences on Win 2003 Server

I have an active server page that works fine on a W2K server & exchange 2000 but am migrating to 2003 server with exchange 2003.
The page now returns an error when the page attempts to send the message with "iMsg.Send"
Anyone got any thoughts?

The subroutine code follows:-

Sub WhaleMailApproved
      'Create the CDO connections.
      Dim iMsg, iConf
      Dim Flds
      Const cdoSendUsingPort = 2
      Set iMsg = CreateObject("CDO.Message")
      Set iConf = CreateObject("CDO.Configuration")
      Set Flds = iConf.Fields

      'SMTP server configuration.
      With Flds

            'SMTP Parameters
            .Item(cdoSendUsingMethod) = cdoSendUsingPort
            .Item(cdoSMTPconnectiontimeout) = 30
            .Item(cdoSMTPServerPort) = 25
            .Item(cdoSMTPAuthenticate) = 1
            
            .Item(cdoSendUserName) = "Administrator"
            .Item(cdoSendPassword) = "*********"            
            
            'Set the SMTP server address here.
            .Item(cdoSMTPServer) = "192.168.65.253"
      
            .Update
      End With

      'Set the message properties.
      With iMsg
            Set .Configuration = iConf
            .From = "bookings@whalewatching.net"
            .To = "bookings@whalewatching.net"
            .Subject = "Booking Confirmation - " & CStr(transaction_number)
            MailBody =      "<font face=" & CHR(34) & "Verdana" & CHR(34) & " size=" & CHR(34) & "2" & CHR(34) & " color=" & CHR(34) & "000000" & CHR(34) & ">"      
            MailBody =      MailBody & Lastname & ", " & Firstname & "(ID:" & Trim(ID) & ", Phone: " & Trim(Phone) & " Email: " & ClientEmail & ")"
             MailBody =      MailBody & " has made Booking Number <b>"
             MailBody =      MailBody & CStr(transaction_number)
             MailBody =      MailBody & "</b> through the Website on " & Trim(BookDate) & ".<br><br>"
            MailBody =      MailBody & "Please check that this booking has been posted to MOMS correctly.<br><br>"
            MailBody =      MailBody & "The total amount paid was $" & FormatNumber(CStr(Paid),2)
            MailBody =      MailBody & " for " & FormatNumber(CStr(TotalPax),0) & " Pax"
            MailBody =      MailBody & " for the cruise on " & CruiseDate
            MailBody =      MailBody & "<br><br>Pax details are:-<br>"
            If AdultDir <> "0" Then
                  MailBody =      MailBody & "<br>" & CStr(AdultDir) & " x Adult - Direct"
            End If
            If ConcDir <> "0" Then
                  MailBody =      MailBody & "<br>" & CStr(ConcDir) & " x Concessional - Direct"
            End If
            If ChildDir <> "0" Then
                  MailBody =      MailBody & "<br>" & CStr(ChildDir) & " x Child - Direct"
            End If
            If FamilyDir <> "0" Then
                  MailBody =      MailBody & "<br>" & CStr(FamilyDir) & " x Family - Direct"
            End If
            If AdultEx <> "0" Then
                  MailBody =      MailBody & "<br>" & CStr(AdultEx) & " x Adult - Ex " & BusFrom
            End If
            If ConcEx <> "0" Then
                  MailBody =      MailBody & "<br>"  & CStr(ConcEx) & " x Concessional - Ex " & BusFrom
            End If
            If ChildEx <> "0" Then
                  MailBody =      MailBody & "<br>" & CStr(ChildEx) & " x Child - Ex" & BusFrom
            End If
            If FamilyEx <> "0" Then
                  MailBody =      MailBody & "<br>" & CStr(FamilyEx) & " x Family - Ex "  & BusFrom
            End If                  
            MailBody =      MailBody & "<br><br>Pickup: " & Pickup
            MailBody =      MailBody & "<br><br><b>The Whalewatching Web Assistant</b></font>"
            .HTMLBody = MailBody
      End With

      'Send the message.
      iMsg.Send

      'Clean Up
      Set iMsg      = Nothing
      Set Flds      = Nothing
      Set iConf      = Nothing
            
End Sub
mrbungle50Asked:
Who is Participating?
 
mass2612Connect With a Mentor Commented:
Hi,

Not sure if this will help but here's  a sub routine I use for sending e-mails from my scripts.

Dim objMessage
Dim strSender, strSendTo, strSMTPServer, strDomain

Sub subSendMail
 Set objMessage = CreateObject("CDO.Message")
     objMessage.Subject = "Enter subject here - " & objPrintQueue.Name      ' sets the subject line
     objMessage.Sender = strComputer & "@domainname.com" ' sets the sending address
     objMessage.From = strComputer & "@domainname.com" ' sets the sending address
     objMessage.To = "emailaddress@domainname.com"      ' sets the to address
     objMessage.TextBody = "Print queue is: " & objPrintQueue.Jobs     ' adds the queue size to message
     objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
     'SMTP Server
     objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtpserver.domainname.com"
     'SMTP Port
     objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
     objMessage.Configuration.Fields.Update
     objMessage.Send
End sub
0
 
kevp75Connect With a Mentor Commented:
what's the error you get?
0
 
mrbungle50Author Commented:
the error is HTTP 500 internal server error
the website cannot display the page
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.

 
kevp75Commented:
ok.  Can you make sure that you have turned off 'Friendly HTTP Errors' in your browser, and post back what the error really is  (or...just post a link to the page...)
0
 
mrbungle50Author Commented:
0
 
kevp75Commented:
ok.  The issue is the fact that you do not have an EOF check before trying to pull a record.

In other words.  Your sub-routine is fine.  It's in the page ewaystatus.asp where you call a recordset that the problem lies

can you post the code here?
0
 
mrbungle50Author Commented:
line 143 is imsg.send
0
 
kevp75Commented:
p.s.  For sake of the other experts that may want to get involved...the error is:
ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/eWaystatus.asp, line 173
0
 
mrbungle50Author Commented:
Hi mass2612

That worked - thank you.

My problem now is that my exchange 2003 server will only allow an email to resolve internally. Can send to an email address outside of the servers domain?
0
 
mass2612Commented:
No problem. I am not sure what you might need to change to be able to send externally. I have never tried it. What happens when you try to use an external address are you getting a relay denied error or similar?
0
 
mrbungle50Author Commented:
Hi mass2612,

Yes the error message is relay denied yet on the exchange 2000 server the same settings work fine. Is there something new in 2003 I need to set as it wont allow us to send email with relay off. With the original code you'll note we sent the administrator username & password yet in the copy you sent me it is not present. Could this have something to do with it?

Thank you.
TL
0
 
mass2612Commented:
As I said I'm not sure about the script but you probably need to check the relay setup on the boxes. If you still have access to the Ex 2000 server then check the relaying for the virtual smtp server under Admin group > Server name > Protocols > Right clicn the virtual smtp server > Properties > Access make a note of the domains and settings allowed to send.

Then compare these settings with the Exchange 2003 server the settings are in pretty much the same space off the top of my head.
0
 
mass2612Commented:
One more thing under the virtual smtp server properties on the Ex 2003 box, under Access > Authentication is allow annonymous authentication enabled?
0
 
mrbungle50Author Commented:
All done - none were set in the old server however I aded the IP address & subnet mask of he new & working fine. Thanks heaps for your time & assistance.
0
 
mass2612Commented:
Good to hear.
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.