javascript and asp email

R

rvj

Im attempting to convert a simple CDO VB script to Javascript but keep
getting Internal Error 500. The VB version works fine.

As far as I can tell all I need to do change the object definition and add
the language declaration.

Can anyone see what is wrong with the object definition?


<%@ language=javascript %>
<%

objMail = Server.CreateObject("CDO.Message")
// objMail = New Server.CreateObject("CDO.Message")

objMail.From="x.y.z"
objMail.To="(e-mail address removed)"
objMail.Subject="topic"
objMail.TextBody="text"
objMail.Send

%>
 
A

Anthony Jones

rvj said:
Im attempting to convert a simple CDO VB script to Javascript but keep
getting Internal Error 500. The VB version works fine.

As far as I can tell all I need to do change the object definition and add
the language declaration.

Can anyone see what is wrong with the object definition?


<%@ language=javascript %>
<%

objMail = Server.CreateObject("CDO.Message")
// objMail = New Server.CreateObject("CDO.Message")

objMail.From="x.y.z"
objMail.To="(e-mail address removed)"
objMail.Subject="topic"
objMail.TextBody="text"
objMail.Send

%>

Is it a 500 or a 500.100?

If 500.100 what is the error text supplied with the error.

You have 'Send detailed error messages' enabled on the App Debugging tab of
the Application Configuration dialog? You can open this dialog from
application properties home directory tab.

You tested the original VBScript version on the same server before porting
to Javascript and it worked?

use:-

Language = JScript

no javascript

You have configured the mail settings on the server extensions tab of the
application properties dialog?
 
R

rvj

thanks for your response (s)
Is it a 500 or a 500.100?

HTTP 500 Internal server error appears on the IE title bar - the content
displays the message "the page cannot be displayed"
You have 'Send detailed error messages' enabled on the App Debugging tab
of
the Application Configuration dialog?

I presume the dialog is an asp server facility? - I'm using a n ASP
hosting service so I'll try and find out
You tested the original VBScript version on the same server before porting
to Javascript and it worked?

yes - on the same server in the same directory vbmail.asp and jsmail.asp
Language = JScript

ok will try this next

You have configured the mail settings on the server extensions tab of the
application properties dialog?

again I assume this is hosting service issue
 
R

rvj

PS I tried using JScript instead of javscript without success

Does anyone one know if there is a case issue with the object properties?

.... or can anyone simply confirm that this should work !!!!

(reading some of the JSCRIPT examples on the MSDN website I m coming across
a number of asp examples where it specifically excludes JScript )
 
A

Anthony Jones

rvj said:
thanks for your response (s)


HTTP 500 Internal server error appears on the IE title bar - the content
displays the message "the page cannot be displayed"

Do you have a windows XP Pro with IIS installed you could (and should) test
your code there before uploading to the host.
I presume the dialog is an asp server facility? - I'm using a n ASP
hosting service so I'll try and find out


yes - on the same server in the same directory vbmail.asp and jsmail.asp

Ok so that's odd. There is nothing wrong with your code as it is if the
VBScript version of it is working. Have you confirmed that JScript itself
is ok on the host.

Something like:-

<%@ Language=JScript%>
<%

var s = 'Hello World'

response.write(s)

%>


ok will try this next



again I assume this is hosting service issue

Yes if the host is allowing you to send mail from their server they should
have configured these settings.
 
A

Anthony Jones

rvj said:
PS I tried using JScript instead of javscript without success

Does anyone one know if there is a case issue with the object properties?

The object in question is an ordinary COM object (CDO.Message). It is not
case sensitive. That said your casing looks fine even if it were.
 
R

rvj

OK FYI

objMail.send()

Many thanks


Anthony Jones said:
Do you have a windows XP Pro with IIS installed you could (and should)
test
your code there before uploading to the host.


Ok so that's odd. There is nothing wrong with your code as it is if the
VBScript version of it is working. Have you confirmed that JScript itself
is ok on the host.

Something like:-

<%@ Language=JScript%>
<%

var s = 'Hello World'

response.write(s)

%>




Yes if the host is allowing you to send mail from their server they should
have configured these settings.
 
E

Evertjan.

Anthony Jones wrote on 15 feb 2007 in
microsoft.public.inetserver.asp.general:
Ooh that's embarrasing. It's very difficult thinking in JScript when
looking at ASP code. :$

There is NO ASP code, ASP being a platform for serverside vbs, js, etc.

js is just as valuable under asp as vbs, and sometimes far simpler, as with
regex, or even the only choice, as with dateObj.getTimezoneOffset()

Getting the best of both by mixing the serverside code is simple.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top