Form element and mailto feature

For general web development questions that are not specifically related to CSS HTML Validator. This includes (but is not limited to) general HTML, CSS, Accessibility, JavaScript, and SEO questions.
Post Reply
1.2.3
Rank 0 - Newcomer
Posts: 5
Joined: Mon Jan 28, 2008 10:22 am

Form element and mailto feature

Post by 1.2.3 »

I would like to use the mailto feature with a form element, but I would like to send Cc to more than one recipient than merely just one recipient. What is the correct html code for accomplishing this? For just one recipient it would be <form action="mailto:youraddress@nospam.com" method="post" enctype="text/plain" >

Any help would be greatly appreciated.

ZC

:?:
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post by Albert Wiersch »

Hello,

The proper way to do this would be to use a server-side script to process the form data and email it to whoever it should go to. I'm sure there are lots of scripts available online that you can use.

If you still just want to use "mailto:", then you should only use one email address. There's no standard way to use more than one... if you try to, then it can create various problems with different browsers or not work at all.

You may be able to have it go to one email address, and then that email address sends it out to several email addresses. You would probably need some type of access to configure the email server to do it this way.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
1.2.3
Rank 0 - Newcomer
Posts: 5
Joined: Mon Jan 28, 2008 10:22 am

Using mailto:

Post by 1.2.3 »

In this particular case, I don't have access to server configurations and that is the reason I wanted to use mailto:

I did find a couple of pages that suggest it is possible to send email to carbon copies with mailto, but I couldn't get it to work. One of those pages is located here -->http://www.outfront.net/tutorials_02/ad ... mailto.htm

Any idea what I am doing wrong? I was trying to use

<form action=" a href="Assemblymember.Bass@assembly.ca.gov?subject=Initiative, Referendum, Recall -- Proposed Legislative Reforms&Cc=Senator.Perata@senate.ca.gov&" method="post" enctype="text/plain" >
User avatar
MikeGale
Rank VI - Professional
Posts: 726
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Post by MikeGale »

I've knocked heads with mailto: in the past. Here's a few points that come to mind.

1) Each browser has a different implementation. You need to test.

2) The mail client on a machine varies. To be thorough you need to test whatever your audience has, or the most common mail clients (assuming you don't know what they have!). (That means using VM's, getting the tools licensed or having separate machines.)

3) Those two points above give you a big matrix of tests to run (IE, FF, Opera, Safari X all the emailers). If you automate your tests it would be feasible otherwise good luck to you.

4) In my testing, fairly long ago, I found that some browsers hadn't done a lot of the basics, which cuts down what you can use.

5) I've found some automated edited tools (I'm thinking online editors accessed over http here) completely mess up mailto: links. They don't understand much about them. (May not impact you.)

Long story short. I looked at it, a client was really keen on the idea. The area just stinks and would in reality cost you a fortune to do professionally (mainly in checking/unit testing).

The easy solution is to code your own. (With a modern web development environment it's trivial.)

Failing that I imagine somebody has provided a service to do just that. Maybe a service, to which you could POST data, using XMLHttp say, would be a clean solution. (I'd personally avoid anybody offering a service with GET strings in the URL.) Anybody here know of such a service?

When doing it I suggest not repeating the most common mistake. That's where you don't get a copy of your own email. It's almost standard that web mail forms don't do that. People sending the email won't forget that lack of manners.
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Using mailto:

Post by Albert Wiersch »

zcorker wrote:<form action=" a href="Assemblymember.Bass@assembly.ca.gov?subject=Initiative, Referendum, Recall -- Proposed Legislative Reforms&Cc=Senator.Perata@senate.ca.gov&" method="post" enctype="text/plain" >
That's messed up. :)

If it's even going to work, it would probably be something more like this:

Code: Select all

<form action="mailto:Assemblymember.Bass@assembly.ca.gov?subject=Initiative, Referendum, Recall -- Proposed Legislative Reforms&Cc=Senator.Perata@senate.ca.gov" method="post" enctype="text/plain">
Note that I didn't test the above.

Like Mike suggested, I would highly recommend you look for a service you can use to post the form data to and NOT use mailto:.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post by Albert Wiersch »

Here's a good link on the matter: The Mythical Mailto:
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
Post Reply