Sending mail via form

Posted on 2005-05-09
Medium Priority
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="mailto:name@domain.com ?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
  • 3
  • 2
LVL 32

Expert Comment

ID: 13958123

<FORM name="emailme" method="post" action="mailto:name@domain.com?SUBJECT=sent" 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

ID: 13958141
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 emailto:blah@blah.com).

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

Accepted Solution

Batalf earned 375 total points
ID: 13958151
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

ID: 13958152

Author Comment

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

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

807 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