ASP Javascript CDOSYS Form to Email Example

I'm in need of a ASP Javascript CDOSYS Form to Email Example. All I've found so far is examples for VBScript and I can't seem to convert it across.
N1njaAsked:
Who is Participating?
 
sajuksConnect With a Mentor Commented:
Did you check my previous post ? i'd corrcted it in the above post. Did you try to run the code ?
it was a cut and paste opern error in the case of <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>.

Still since you feel as am not able to understand you am sorry to 've been wasting your time. Hang on and other experts
who have a better understanding than me will help you out.

</UNSUBSCRIBE>

0
 
sajuksCommented:
CDOSYS works only at the server level . Javascript will be used only to check client side validans.
Cbscript is used might be only for validn.
What are you looking for ? Maybe if you post what you've got and explain what you want we might
be able to help you.
0
 
N1njaAuthor Commented:
I use JScript/JavaScript as the ASP Programming Language.

I have multiple forms that previously used CDONTS, but I want to use CDOSYS and need code examples in JavaScript. The only examples I can find are coded in VBScript.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
sajuksCommented:
the mail that is sent  using  CDOSYS  is ASP language. Javascript doent come in the picture over here.
Thats why am trying to find out why you need javascript ? is it to validate your form or what ?
An example or a link would be better  to illustarte your problem

0
 
sajuksCommented:
Its an example using dreamweaver, but  it might be what you are searching for
http://www.cgw3.co.uk/tutorials/tutorial.asp?TutorialID=39&CategoryID=3
0
 
N1njaAuthor Commented:
Do you program ASP? If yes, What Language do you use?


I USE JAVASCRIPT.


I use JavaScript for ASP (Active Server Pages) which runs at the server (Server Side).

I will be using JavaScript for validation (Client Side) when I have completed the Form and CDOSYS Page.
0
 
N1njaAuthor Commented:
Thanks but that example uses VBScript, not JavaScript.
0
 
sajuksCommented:
Did you check the code . its a n asp page with javascrip validn done to ensure that no fields are empty.
If valid the form calls the thankyou.asp page which calls the CDOSYS object.
What can be simpler than that.
I hope you dont think that you can call this without asp ?
0
 
N1njaAuthor Commented:
I refer you to my previous comment:



Comment from N1nja
Date: 10/28/2004 11:35AM BST
 Your Comment  


Do you program ASP? If yes, What Language do you use?


I USE JAVASCRIPT.


I use JavaScript for ASP (Active Server Pages) which runs at the server (Server Side).

I will be using JavaScript for validation (Client Side) when I have completed the Form and CDOSYS Page.
0
 
sajuksCommented:
Check my profile. I believe it speaks for itself.

Yes am involved in various web server languages like asp,jsp,php,powerdynamo.
Client side i prefer javascript.

What i want to simply state is that  create a simple asp page  save it something like mail.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
      <form action="thankyou.asp" method="post" name="fmcontact" id="fmcontact" onsubmit="return yourvalidn()">
        <input name="Name" type="text" id="Name" tabindex="1" onfocus="this.select();" size="50" />
        <input name="Email" type="text" id="Email" tabindex="1" size="50" />
        <textarea name="Details" cols="45" rows="10" id="Details" tabindex="1"></textarea>
        <input type="submit" value="Submit" tabindex="1" />
</form>
</body>

use the thankyou.asp page and se if it works or not.I believe you are getting a bit confused

0
 
sajuksCommented:
Heres a simple validn script which i presume is soemthing you wanted to be sure i knew what you are talking about
// mail.asp page
<% %>
<head>
<script>
function yourvalidn()
{
if ( document.fmcontact.Name.value == "" )
{
alert ( "Enter Name")
return false
}
if ( document.fmcontact.Email.value == "" )
{
alert ( "Enter Email")
return false
}
if ( document.fmcontact.Details.value == "" )
{
alert ( "Enter Details")
return false
}
return true
}
</script>
</head>
<body>
      <form action="thankyou.asp" method="post" name="fmcontact" id="fmcontact" onsubmit="return yourvalidn()">
        <input name="Name" type="text" id="Name" tabindex="1" onfocus="this.select();" size="50" />
        <input name="Email" type="text" id="Email" tabindex="1" size="50" />
        <input name="Details" cols="45" rows="10" id="Details" >
        <input type="submit" value="Submit" tabindex="1" />
      </form></td>
</body>

the thankyou.asp page you already have
0
 
N1njaAuthor Commented:
You might have a great looking profile, but that doesn't mean a thing if you don't understand me.

This is some of what you have sent me:
******************************************************************
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
      <form action="thankyou.asp" method="post" name="fmcontact" id="fmcontact" onsubmit="return yourvalidn()">
        <input name="Name" type="text" id="Name" tabindex="1" onfocus="this.select();" size="50" />
        <input name="Email" type="text" id="Email" tabindex="1" size="50" />
        <textarea name="Details" cols="45" rows="10" id="Details" tabindex="1"></textarea>
        <input type="submit" value="Submit" tabindex="1" />
</form>
</body>
******************************************************************

May I point out this line:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

It tells the server that the programming script used is VBScript not JavaScript as I have stated till I am blue in the face.

Also validation JavaScript is not an issue, I can write that script myself.


In my next comment I will give you an example of my JavaScript ASP.
0
 
N1njaAuthor Commented:
Example Code:

*****************************************************************
<%@ Language=JavaScript %>
<%
var folderPrefix = "";
var navTitle = "home";
var pageTitle = "Home";
%>
<!-- #include file="site_content.asp" -->
<%
function getLeftNav()
{
      var sOut = "";
      sOut += openTable("left",leftWidth, "", navTitle);
      sOut += "<tr><td width=\"196\"></td></tr></table>";
      return sOut;
}
*****************************************************************

This is the first section of the default.asp page.
0
 
kGeniusConnect With a Mentor Commented:
Funny discussion above :-)

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
< %

var iMsg = Server.CreateObject("CDO.Message")
var iBodyPart = iMsg.BodyPart;
iBodyPart.ContentTransferEncoding = "8bit";

var iConf = Server.CreateObject("CDO.Configuration")
iConf.Fields("cdoSMTPServerName") = "smtp.domain.com"
iMsg.Configuration = iConf

var msg = "Message via CDOSYS and Javascript" ;
iMsg.To = "somebody@domain.com";
iMsg.From = "me@domain.com";
iMsg.Subject = "CDO Test jscript";
iMsg.TextBody = msg;
iMsg.send()

%>


Hope this'll help
Greetings,
kGenius
0
 
N1njaAuthor Commented:
Will check it out in the next hour.

Did you understand what I was saying in above discussion.
0
 
kGeniusCommented:
The discussion was about the Script Language you can use on a ASP-page?
You use JScript (or Javascript), sajuks thought you could only use VBscript to make ASP. Wich is not true. VB is the most used Server sided script (javascript the most client-sided script) But they work both fine server-sided. You can even use other languages (third-party lang) in ASP scripts. The third-party languages should be installed then.
So it was an unusefull discussion. But I found it funny, because you were talking next to each other. Correct me if I thought wrong =)
Hope the script works. I'm not that good in Javascript server-sided.

kGenius
0
 
kGeniusCommented:
Hope the script works, I can use the points ;)
0
 
N1njaAuthor Commented:
It's the best thing I've found yet, can you tell me where you found/learnt this example.

In reference to the discussion I knew that "sajuks" didn't quite understand me but I understood him, strange on his part because he is a JavaScript Expert apparently.
0
 
N1njaAuthor Commented:
Sorry to split it but surely he needs some encouragement.
0
All Courses

From novice to tech pro — start learning today.