Results 1 to 4 of 4

Thread: email form

  1. #1
    Join Date
    Dec 2005
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default email form

    hi, i am trying to make a page on which there is text field that says "type your email address" and another saying "type your message". i want a "submit" button on the bottom of the page to send the message from the "type your message" box to the email address in the "type your email address" box. i need this to be done without opening an email service with the "to" and "content" sections filled out. i need the java or whatever to do it all itself. like, i would have the javascript send the message entered to the email address entered from my email address that is somehow built into the javascript. is that possible?

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Ah... you can, unreliably. However, it's a far better idea to use a free mail-processing service like Mail Maniac.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Dec 2005
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    could you explain this unreliable way to do it, just so i can see how unreliable it is for myself? also, the mailmaniac service emails the info entered to the webmaster, not the user. i need the infor entered to be emailed to the user. thanks

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It can be mailed to whomever you choose. If you look in the code it generates, you'll see:
    Code:
    <input type="hidden" name="mailto" value="your(at)emailaddress.com">
    If you change this to:
    Code:
    <input type="text" name="mailto" onkeyup="this.value = this.value.replace(/@/g, '(at)');">
    it will show a textbox in which the user can type the email address to send to.

    The unreliable way is:
    Code:
    <form method="post" action="mailto:user@domain.tld">
    which will send the data (if the user is using a compatible browser, and doesn't have a firewall that will stop this, and has an email client that will let this through) in an ugly and just-barely-readable format (e.g. "Check out http://www.google.com!" would become "Check+out+http%58%2f%2fwww%2egoogle%2ecom%33" in an attachment to an email, the name of which would vary depending on the browser used).
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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