...

View Full Version : ASP/JavaScript CDO Message



gunuag
03-19-2007, 09:11 PM
Hi,

I am currently having difficluty with creating an ASP CDO Message Code that uses JavaScript as its server-side language. I know the VBScript one, but I cannot use that.

The VBScript one is:

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>

I know that the ASP/JavaScript code must start with:

<%@ language="JavaScript"%>

--
Gunu

telmessos
03-19-2007, 09:35 PM
I don't understand why you need the javascript. ASP pages accepts the VB language and you can use the same codes. Please ask it with more details. Maybe I can help.
Thanks

gunuag
03-19-2007, 09:49 PM
Either the whole page is written in VBScript, or the whole page is written in JavaScript. I have other codes on the same page, in JavaScript. So I'll either have to change all of that into VBScript and have no trouble with the mail code; or i'll have to keep all of it in JavaScript and modify the Mail Code.

oracleguy
03-20-2007, 12:39 AM
Actually, I believe with ASP you can mix JavaScript and VBScript on the same page. I'm not saying its a good coding practice but it is possible.

SSJ
03-20-2007, 06:25 AM
Just modify the mail code

gunuag
03-20-2007, 06:23 PM
I have tried to change the code...

I don't know what to do though.
I think the problem is in the SET thing

SSJ
03-21-2007, 11:18 AM
post your whole page code

miranda
03-21-2007, 04:32 PM
To send with Javascript as the server side language
<%
myMail= new ActiveXObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.TextBody="This is a message."
myMail.Send
%>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum