Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP Javascript CDOSYS Form to Email Example

Posted on 2004-10-28
19
Medium Priority
?
4,661 Views
Last Modified: 2008-01-09
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.
0
Comment
Question by:N1nja
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 7
  • 3
19 Comments
 
LVL 33

Expert Comment

by:sajuks
ID: 12431817
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
 

Author Comment

by:N1nja
ID: 12431937
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
 
LVL 33

Expert Comment

by:sajuks
ID: 12432014
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 33

Expert Comment

by:sajuks
ID: 12432069
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
 

Author Comment

by:N1nja
ID: 12432079
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
 

Author Comment

by:N1nja
ID: 12432088
Thanks but that example uses VBScript, not JavaScript.
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12432143
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
 

Author Comment

by:N1nja
ID: 12432163
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
 
LVL 33

Expert Comment

by:sajuks
ID: 12432244
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
 
LVL 33

Expert Comment

by:sajuks
ID: 12432282
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
 

Author Comment

by:N1nja
ID: 12432368
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
 

Author Comment

by:N1nja
ID: 12432386
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
 
LVL 33

Accepted Solution

by:
sajuks earned 60 total points
ID: 12432414
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
 
LVL 7

Assisted Solution

by:kGenius
kGenius earned 1140 total points
ID: 12432791
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
 

Author Comment

by:N1nja
ID: 12433708
Will check it out in the next hour.

Did you understand what I was saying in above discussion.
0
 
LVL 7

Expert Comment

by:kGenius
ID: 12434212
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
 
LVL 7

Expert Comment

by:kGenius
ID: 12434226
Hope the script works, I can use the points ;)
0
 

Author Comment

by:N1nja
ID: 12436596
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
 

Author Comment

by:N1nja
ID: 12436627
Sorry to split it but surely he needs some encouragement.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question