IIS ASP - javascript and asp email

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > February 2007 > javascript and asp email





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author javascript and asp email
rvj

2007-02-13, 7:22 am


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="someone@somewhere.net"
objMail.Subject="topic"
objMail.TextBody="text"
objMail.Send

%>


Anthony Jones

2007-02-13, 7:22 am


"rvj" <rvj@rolemodels.net> wrote in message
news:%23rKlNj1THHA.4668@TK2MSFTNGP04.phx.gbl...
>
> 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="someone@somewhere.net"
> 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?



rvj

2007-02-13, 7:22 am

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

"Anthony Jones" <Ant@yadayadayada.com> wrote in message
news:%23AV2Z21THHA.4028@TK2MSFTNGP03.phx.gbl...
>
> "rvj" <rvj@rolemodels.net> wrote in message
> news:%23rKlNj1THHA.4668@TK2MSFTNGP04.phx.gbl...
>
> 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?
>
>
>



rvj

2007-02-13, 1:17 pm

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 )

"rvj" <rvj@rolemodels.net> wrote in message
news:%23kvLDu2THHA.5108@TK2MSFTNGP06.phx.gbl...
> 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"
>
>
> 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 will try this next
>
>
>
> again I assume this is hosting service issue
>
> "Anthony Jones" <Ant@yadayadayada.com> wrote in message
> news:%23AV2Z21THHA.4028@TK2MSFTNGP03.phx.gbl...
>
>



Anthony Jones

2007-02-13, 1:17 pm


"rvj" <rvj@rolemodels.net> wrote in message
news:%23kvLDu2THHA.5108@TK2MSFTNGP06.phx.gbl...
> 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
>
porting[vbcol=seagreen]
>
> 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
>
>
the[vbcol=seagreen]
>
> 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.



Anthony Jones

2007-02-13, 1:17 pm


"rvj" <rvj@rolemodels.net> wrote in message
news:u2Kk%23K3THHA.4028@TK2MSFTNGP03.phx.gbl...
> 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.


> ... 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 )
>
> "rvj" <rvj@rolemodels.net> wrote in message
> news:%23kvLDu2THHA.5108@TK2MSFTNGP06.phx.gbl...
tab[vbcol=seagreen]
the[vbcol=seagreen]
tab[vbcol=seagreen]
the[vbcol=seagreen]
>
>



rvj

2007-02-15, 7:21 am


OK FYI

objMail.send()

Many thanks


"Anthony Jones" <Ant@yadayadayada.com> wrote in message
news:OK$Lsl3THHA.2212@TK2MSFTNGP02.phx.gbl...
>
> "rvj" <rvj@rolemodels.net> wrote in message
> news:%23kvLDu2THHA.5108@TK2MSFTNGP06.phx.gbl...
>
> Do you have a Windows XP Pro with IIS installed you could (and should)
> test
> your code there before uploading to the host.
>
> porting
>
> 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)
>
> %>
>
>
>
> the
>
> Yes if the host is allowing you to send mail from their server they should
> have configured these settings.
>
>
>



Anthony Jones

2007-02-15, 7:21 am


"rvj" <rvj@rolemodels.net> wrote in message
news:utGX5lPUHHA.1200@TK2MSFTNGP02.phx.gbl...
>
> OK FYI
>
> objMail.send()
>


Ooh that's embarrasing. It's very difficult thinking in JScript when
looking at ASP code. :$



Evertjan.

2007-02-15, 7:21 am

Anthony Jones wrote on 15 feb 2007 in
microsoft.public.inetserver.asp.general:

>
> "rvj" <rvj@rolemodels.net> wrote in message
> news:utGX5lPUHHA.1200@TK2MSFTNGP02.phx.gbl...
>
> 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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com