Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13

Thread: E-mail help

  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Woodland Hill, Ca
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry E-mail help

    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.

    <HTML>
    <HEAD>
    <TITLE>Bill's-send-mail</Title>
    </HEAD>
    <BODY LINK="#0000ff">
    <script Language="JavaScript">
    <!--Hide
    // function submits a form
    function submitForm(form){
    document.form1.submit(form);
    }
    // End Hide -->
    </SCRIPT>
    <form name="form1" method="post" action="http://www.sendfree.com/arform.cgi">
    <input type="hidden" name="type" value="1">
    <input type="hidden" name="id" value="39241">
    <input type="hidden" name="name" value="Bill Corbett" size="40">
    <input type="hidden" name="email" value=billMesg>
    <input type="hidden" value="Submit" onclick = submitForm(this.form)>
    </form>
    <script Language="JavaScript">

    // 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.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've never tried this type of ActiveX script, but this looks like a typo:

    while(!myInputTextStream.AtEndfStream){

    Shouldn't that be:

    while(!myInputTextStream.AtEndOfStream){

    ?
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #3
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Woodland Hill, Ca
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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. ;)

  • #5
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Woodland Hill, Ca
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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. ;)

  • #7
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Woodland Hill, Ca
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Last edited by whammy; 07-27-2002 at 02:21 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #9
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Woodland Hill, Ca
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #10
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    // 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. ;)

  • #11
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Woodland Hill, Ca
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #12
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your "server" must have a method to reply with.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #13
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Woodland Hill, Ca
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is the post in the form not enough?
    Bill...I will if you will and we will together.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •