Solved

Do Mailto Forms Only Work On Web Servers?

Posted on 2007-04-10
11
207 Views
Last Modified: 2013-11-19
I want to make a mailto: form that will sit on our network. It will only be for in-house users.

Will this work is the page is just a file on our network? Or does it have to be on a web hosting server to work?

I tried this:

<form action="mailto:me@myemail.org" method="post" enctype="text/plain" name="form1" onSubmit="MM_goToURL('parent','thanks.htm');return document.MM_returnValue">

The goToURL part works just fine, but I didn't get the e-mail.

What do I have to change?

Thx!
0
Comment
Question by:mksalva
  • 6
  • 4
11 Comments
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 18885476
It works only if the person viewing the page also has a mail client such as Outlook.  It just instructs the browser to open the default mail client with a message partially filled waiting for the user to hit send.

In your case you usurped the default action (e.g. open the client) with the call to the thank you page and especially the return document.MM_returnValue part.
0
 

Author Comment

by:mksalva
ID: 18885487
We have Outlook on our computers here, mine included, but when I clicked Submit, that did not happen. Did I leave out something essential?
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 18885505
No you put something bad in.

Take out the onsubmit event entirely.
0
 

Author Comment

by:mksalva
ID: 18885547
I removed the onSubmit event and it worked. So onSubmit events are a no-no for this sort of thing?

Also, when the e-mail arrived, the subject line read "Form posted from Microsoft Internet Explorer." Is there a way that I can customize the subject line?

Thanks for your help.
0
 
LVL 29

Accepted Solution

by:
rdivilbiss earned 125 total points
ID: 18885560
This will prefill the message including the subject line.

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>New Page 1</title>
</head>

<body>
<form action="mailto:test@test.com"><!--note I need nothing but the action-->
<p>From: <input name="from" value="test@test.com" size="25"></p>
<p>Subject: <input name="subject" value="Test Mail" size="25"></p>
<p>Message: <input name="body" value="Test Message" size="25"></p>
<p><input type="submit" value="Submit"></p>
</form>
</body>

</html>

http://www.ianr.unl.edu/internet/mailto.html
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:mksalva
ID: 18890651
If I only use the action, then all the words in the completed fields have plus signs (+) where the space bars should go. For example, if I type "This is a test" in a text field, the result in the e-mail looks like this:

This+is+a+test

If I use <form action="mailto:me@domain.org" method="post" enctype="text/plain" name="form1"> then the text looks normal:

This is a test

Is there an easy way to use the second method and still get a customized subject line?

Thx!
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 18891014
That is the default encoding and I'm not sure that you will be able to change that.

If you want to add JavaScript to the mix, you could add onchange="javascript:this.value=escape(this.value)" to each field...

then you'll likely get This%20is%20a%20test but it may display correctly in the e-mail.
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 18891034
Mailto is really a horrible way to send mail from a web server.

If you have IIS, and can install the SMTP server, then you can send via ASP:

http://www.rodsdot.com/ee/How_To_Send_Email_ASP.asp

If you have PHP you can use the mail function.
0
 

Author Comment

by:mksalva
ID: 18891089
What is IIS?  (I'm ignorant, I know...)

I just want to have a way for folks in our organization to send me requests for web site changes online.

Thx!
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 18891286
What is your web server's operating system?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

757 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

19 Experts available now in Live!

Get 1:1 Help Now