I have written the following code. I am new to Java Script and can not uderstand why it wont work. Can someone please help?
The code requires a text file of e-mail addresses on the "C" drive.
// Create an instance of the File object.
var myFileSysObj = new ActiveXObject("Scripting.FileSystemObject");
// Try to open the file.
var myInputTextStream = myFileSysObj.OpenTextFile("c:\\tstemail.txt",1,true);
// If there was not an error, then open the file and display it.
while(!myInputTextStream.AtEndfStream){
var billMesg = myInputTextStream.ReadLine();
submitForm();
}
// Close the input
myInputTextStream.Close()
</SCRIPT>
</BODY>
</HTML>
__________________
Bill...I will if you will and we will together.
Thanks Whammy,
But that is not the problem. I use DreamWeaver to step through the code. I have several e-mail addresses and none of them sre submitted.
__________________
Bill...I will if you will and we will together.
Did you try it? Like I said, I've never used an ActiveX script like that... but I would bet you $25 that's a typo... whether or not you did it or DreamWeaver (yech) did.
If it will work once you correct the mistake or not, I have no idea.
__________________
Former ASP Forum Moderator - I'm back!
If you can teach yourself how to learn, you can learn anything. ;)
Hi Whammy,
First I did correct it, and ends correctly now. Second it did not correct the problem, and third I userd DreamWeaver to try to help find the problem. This script cycles thru each e-mail and attempts send it to the designated location.
__________________
Bill...I will if you will and we will together.
Why don't you just hard code the email address into an array in javascript?
The sad thing is, stuff like this is really easy if you're using a server-side scripting language. You would be much better off doing something like that.
__________________
Former ASP Forum Moderator - I'm back!
If you can teach yourself how to learn, you can learn anything. ;)
Hi Again Whammy,
I don't know if this is server side or not, but I have to be able to send various e-mails from all over the place to one location. I must filter each e-mail to one location regardless as to the original senders loction. I also must receive e-mails from mamy different formats. If you know how this can be done under my control, I would gladly junk this and use what ever you recommed.
__________________
Bill...I will if you will and we will together.
It definitely sounds like you need to use the server-side scripting language of your choice, and perhaps a database (although you can use a flat file for email addresses if it's not too big!).
That enables people from "many locations" to send stuff (whatever kind of information it may be) to "one location" (your server).
Other than that, I can only really tell you to research it yourself... it's not hard to go server-side, but you have to learn it on your own.
__________________
Former ASP Forum Moderator - I'm back!
If you can teach yourself how to learn, you can learn anything. ;)
Thanks Whammy,
But I need to try to figures this out. Everything appears to work. I get no errors, but I do not send anything. The server responds but nothing happens. Oh well I guess I will leave it here and maybe someone can help.
Thanks for your help.
__________________
Bill...I will if you will and we will together.
// If there was not an error, then open the file and display it.
while(!myInputTextStream.AtEndfStream){
var billMesg = myInputTextStream.ReadLine();
submitForm();
I don't see anything here that actually sends an email. Only submits the form...
__________________
Former ASP Forum Moderator - I'm back!
If you can teach yourself how to learn, you can learn anything. ;)
Whammy,
Maybe I have the wong idea here. I thought that if I submit the form with the correct entries, it would be suffient and the server would accept the input and reply. Am I wrong.
__________________
Bill...I will if you will and we will together.