Simple mailto snippet?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yogi_Bear_79

    #1

    Simple mailto snippet?

    I am building a stand alone html help system (.chm.) So the usual woes with
    mailto are not going to be encountered. Likewise I am ensured all my
    intended users have Outlook installed. With that said This is what I want
    to do.

    I have a simple html form with a an radio button option group, a listmenu, a
    text box, and a text area. What I would like to do is have a user fill out
    this form, and hit a button that sends the results via outlook. The TO, CC,
    and subject fields will be hard coded. I want the option from the list menu
    on line one, the radio button on line two, the text box on line three and
    the multi-line text area starting on line 4.

    I haqve searched the web, and groups all day to no avail. Everything I have
    tried simply fails. I even tried breaking this down into a simple one text
    box one button, with no good results via javascript. I can get it to work ok
    without javscript, but instead of new lines they just overwrite each other.




  • Spats30

    #2
    Re: Simple mailto snippet?

    You need to post the form to a simple form handler that uses a
    server-side language like Classic ASP, PHP, or ASP.NET that has a mail
    script you can configure. JavaScript does not send emails.

    Determine what technology your server uses, then check for a simple
    mail script using that technology. Should be easy.

    Comment

    • Yogi_Bear_79

      #3
      Re: Simple mailto snippet?


      Sorry, It is designed for a .chm file. SO it must be client side. I realize
      that javascript doesn't send e-mail, but it can send via mailto, I need help
      with that[color=blue]
      >[/color]


      Comment

      • RobG

        #4
        Re: Simple mailto snippet?

        Yogi_Bear_79 wrote:[color=blue]
        > I am building a stand alone html help system (.chm.) So the usual woes with
        > mailto are not going to be encountered. Likewise I am ensured all my
        > intended users have Outlook installed. With that said This is what I want
        > to do.[/color]

        Given the above caveat, play with the following. Note that I
        think Outlook has a 2,000 character limit on what you can send
        via mailto. Lotus Notes has a limit of about 200 characters:


        <script type="text/javascript">
        function prepMail(f) {
        var previewHTML =
        '<b>To:</b> ' + f.address.value + '<br>'
        + '<b>cc:</b> ' + f.cc.value + '<br>'
        + '<b>Subject:</b> ' + f.subject.value + '<br>'
        + '<b>Body:</b><br> '
        + f.body.value.re place(/\n/g,'<br>') + '<br>'
        + '<a href="mailto:' + f.address.value
        + '?cc=' + f.cc.value
        + '?subject=' + f.subject.value
        + '?body=' + escape(f.body.v alue)
        + '">Click here to send</a>'
        ;
        document.getEle mentById('previ ewPane').innerH TML = previewHTML;
        }

        </script>

        <form action="" name="mailForm" >
        <input type="text" name="address"
        value="someone@ hotmail.com">To <br>
        <input type="text" name="cc"
        value="someoneE lse@hotmail.com ">cc<br>
        <input type="text" name="subject"
        value="Test of mail to">Subject<b r>
        <b>Body</b><br>
        <textarea name="body" value="someone@ hotmail.com"
        rows="20" cols="50">Body</textarea><br>
        <input type="button" value="Preview message" onclick="
        prepMail(this.f orm);
        ">
        </form>
        <table style="border: 1px solid blue"><tr><td width="50%">
        <span id="previewPane "><i>previe w will appear here</i><span>
        </td></tr></table>



        --
        Rob

        Comment

        Working...