www.webdeveloper.com
Results 1 to 7 of 7

Thread: Tell A Friend Script

  1. #1
    Join Date
    Jan 2003
    Location
    CA
    Posts
    42

    Angry Tell A Friend Script

    Ok, please take a look at the script and tell me what I am not doing or doing wrong. It shows that it send the email, however, in testing it to myself, I never receive the email.

    Here is the website page: try it to yourself, you'll see what I mean.

    http://www.partytimeprinting.com/refer_friend.asp

    It's not formatted yet, the style at least, I just want to get it to work. PLEASE!!!! SOMEONE!!!


  2. #2
    Join Date
    Jan 2003
    Location
    Lewiston ME
    Posts
    75

    Unhappy

    The link appears to be non existant. Please post the code.

  3. #3
    Join Date
    Jan 2003
    Location
    CA
    Posts
    42

    Refer Friend Code

    Sorry, I don't know why you cannot access it.
    I have attached the code I have in .txt format.

    The below thread is the code for the confirnation page.
    Attached Files Attached Files

  4. #4
    Join Date
    Jan 2003
    Location
    Lewiston ME
    Posts
    75

    Thumbs up

    In theory this should work. The cgi that is on my server will not allow me to send to multiple recipients at once but I think that at least it gives a clear picture of what needs to be accomplished for the script to work.

    //--after the script checks all the form fields...

    if (msg.length==0) {
    sendOut();
    //!--Calls the new function instead of document.frmRAF.submit();
    }
    else {
    msg = "The following things need to be corrected:\n\n" + msg
    msg += "\nPlease try again!"
    alert(msg)
    }
    }

    //!--Your script does not have a function to determine how many times to send
    //!--Nor does it pass to the form the email addresses of the friends so it can send.
    //!--I have written a function here called sendOut() to take care of it.
    //!--There may be a shorter way to write it, but you get the idea.
    function sendOut() {
    var ea = document.frmRAF.txtFriend1_Email_Addr_Txt.value;
    var eb = document.frmRAF.txtFriend2_Email_Addr_Txt.value;
    var ec = document.frmRAF.txtFriend3_Email_Addr_Txt.value;
    if (ea.length > 1 && eb.length > 1 && ec.length > 1) {
    //!--I use submit_to because my cgi requires it to process the form
    //!--You may need to change it to match your requirement for "send to:"
    document.frmRAF.submit_to = ea + "," + eb + "," + ec;
    document.frmRAF.submit();
    }
    else if (ea.length > 1 && eb.length > 1 && ec.length == 0) {
    document.frmRAF.submit_to = ea + "," + eb;
    document.frmRAF.submit();
    }
    else if (ea.length > 1 && ec.length > 1 && eb.length == 0) {
    document.frmRAF.submit_to = ea + "," + ec;
    document.frmRAF.submit();
    }
    else if (ea.length > 1 && eb.length > 1 && ec.length == 0) {
    document.frmRAF.submit_to = ea + "," + eb;
    document.frmRAF.submit();
    }
    else if (eb.length > 1 && ec.length > 1 && ea.length == 0) {
    document.frmRAF.submit_to = eb + "," + ec;
    document.frmRAF.submit();
    }
    else if (ea.length > 1) {
    document.frmRAF.submit_to = ea;
    document.frmRAF.submit();
    }
    else if (eb.length > 1) {
    document.frmRAF.submit_to = eb;
    document.frmRAF.submit();
    }
    else if (ec.length > 1) {
    document.frmRAF.submit_to = ec;
    document.frmRAF.submit();
    }
    }
    </script>

  5. #5
    Join Date
    Jan 2003
    Location
    CA
    Posts
    42

    /???

    Here goes the idiot in me....where do I put the code and which part do I put? I also have a cgi bin and a cgi-local and aspnet_client file.......does that help? I am a cut-n-paste girl, that's as far as my expertise goes.

  6. #6
    Join Date
    Jan 2003
    Posts
    628
    If you are using ASP you can use the CDONTs("NewMail") object which is a part of IIS to send email. If you look at any any ASP site you will find examples. It is really easy to get working and reliable.
    Also, ask your web host if they have ASPEmail on the server. This component allows you to send mail to queue so there is no chance of your page timing out before the mail server has dealt with the requests.

  7. #7
    Join Date
    Jan 2003
    Location
    Lewiston ME
    Posts
    75
    here is the entire code you originally posted with my function in the desired place. I wonder if you have a working feedback form or something that would give me an idea of what your server's cgi is looking for in terms of submit_to
    If you have something like that or if you can get that information from your service provider then I can make the required changes and repost the code once more.

    I don't know much about ASP yet so if you want to use ASP options for sending email someone else will have to adjust the code I wrote to make it work (sorry). I do know, however that you can use the cgi that is in place on your server on the ASP pages instead of using the ASP method for send mail.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles