Sending mail via form

Posted on 2005-05-09
Last Modified: 2010-04-09

I'd like to have a form on my site, which will be like all other "Contact Me"s out there. Anyone can write something in the form, and when pressing "send", the text will be emailed to an address I set beforehand in the code. It is very common, I jsut don't know how to do it, and with which language. The code someone offered me is:

<FORM name="emailme" method="post" action=" ?SUBJECT=sent" enctype="text/plain" onSubmit="return true">

<input type="submit" name="submit" value="send">

This doesn't work (Windows asks me for my SMTP server, my email, etc.)

Any ideas?
Question by:Partitioner
    LVL 32

    Expert Comment


    <FORM name="emailme" method="post" action="" enctype="text/plain" onSubmit="return true">

    is a method used to send data from your form by your default mail program.

    It looks to me that you

    a) Don't have the correct mail program associated with your browser(Tools->Internet Options->Programs in IE) or
    b) Haven't configured a mail account

    The code above works in my browser by the way.


    Author Comment

    That's the thing, I don't want the code to be dependant on the user's default email program. I want the "send" button to be the only thing the user has to do. In most websites this doesn't open your email program (like a simple

    Do you understand what I mean? i'm searching for an example now.
    LVL 32

    Accepted Solution

    That could only be done if you have access to server side scripts like PHP, ASP or JSP.

    If you do, you could post the form to the server and let the server send the email.

    In PHP you have the mail() function as an example.

    The method you're using is the only way to do it if you don't have access to server side scripts.


    Author Comment


    Author Comment

    ok, that's what i thought, but i wasn't sure. thanks a lot.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
    In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now