Mailto: Html Source Code
This page will cover how easy it is to allow people to email their friends from your website using mailto and includes tips and tricks for html forms. I'll try to keep as many links live and working as I can. The email addresses are fake.
|Please keep in mind when adding your email address to your web page, always encrypt it so that spammers can't get a hold of it. I wrote an e-Book on Spam and how to protect your email address. Stop Spam Now is crucial if you want to keep your inbox clean.
Did you ever wonder how you can click on a link or button and up pops your email client, like Outlook Express, with the blank email form partially filled in?
I'm glad you asked :) I'll show you how to do it.
Dreamweaver: Adding subject lines to your Email
This is a cool little HTML tip for automatically including a subject in any e-mail links on your site.
Create some text and then highlight it
This is the same procedure as creating a regular e-mail link, except you're going to add a little extra code after the normal link.
Go up to the Properties Inspector and in the Link field, type in:
mailto:firstname.lastname@example.org?subject=Adding E-mail Subject Is Easy
Now, change the "email@example.com" to your own e-mail address. Keep the "?subject=" and change the other text to match your subject.
Add Content Automatically to the Body of Your Email
You can take this one step further and automatically add a body message to the email your code will look like this
mailto:firstname.lastname@example.org?subject=Adding E-mail Subject Is Easy&body=content for the body of the email to remind me of a specfic reason, location or purpose for this email
Let's look at email html source code
Many people already know about the "mailto attribute" of the <A> tag, we'll take a look at how to use it properly and effectively. Also, we'll explore why someone would want to use mailto:
html mailto: example
We already discussed how to include a subject in the mailto tag but here's an example for those who need to keep looking at how its done. When I see an example over and over, something clicks:)
mailto: subject example
When a visitor clicks on "example" their email client (outlook express) opens up with the To: field already filled in with email@example.com Then the "subject line" is already filled in with freechocolate All your visitor needs to do is click on the Send Button!
Now, before moving on it's worth taking a look at the syntax of "mailto:" notice that there is only one set of double quotes and every thing goes between them
This is really important and is the most common mistake that webmasters make and is nearly always the culprit when something goes wrong with mailto For me it seems odd because it's unusual to include an equals sign = between double quotes.
The mistake below will drive you nuts! Notice there's no 'subject' tag behind the question mark.
The other common mistake when using mailto is to omit the word 'subject',I've done this and it will drive you absolutely crazy trying to figure out where you've gone wrong.
<a href="mailto:firstname.lastname@example.org?=free chocolate">
You may know this stuff, but let me tell you. When I first started building web pages I had a terrible time trying to keep the order of the various tags in the right place. If you already know this stuff, great. Help that new web designer, and send them to this page. You might even want to link to it :)
the best thing about "mailto:"
Probably the best thing about the mailto: tag is very much undocumented and that is, that you can include a message in the body of the email. Think of how powerful this is. By including a message in the email body, you can send yourself a message, you can inform and direct your visitor, since they are sure to read the message before the click on the send button.
What this means is, if you have a mailto link on your website and a user clicks on it, the to:, subject: and body: of the message are already complete, so all that the user has to do is click send.
If you're thinking "so what?" Consider how this can seriously increase the number of visitors, subscribers and buyers to your website, take a quick look at this example.
Imagine putting a link like this example on your homepage : tell a friend
This is the html source code for the working mailto: example above:
<A HREF="mailto:?subject=Check out this website&body=Hi, I found this website and it has a ton of Free Resources and ebooks I knew you would want http://www.Desktop-Wealth.com/ebooks">tell a friend</A>
You may notice that there's no email address in the mailto: example and the link in the web address is not clickable in the body of the email, but it will be when it arrives at the recipient's inbox.
There is a squence of events that can be included in mailto: and this is the key to effectively using the mailto command. Use this right and you'll be miles ahead of the competition. Use your imagination and you'll be able to smoothly capture email addresses, offer free products and attract new visitors!
- the first one is the question mark ?
- the second one is the ampersand &
mailto sequence quick reference
|? must be used first and once only
|& use as many of these as you want but should be preceeded by ? or else everything after & is interpreted as a seperate to: address
|&cc use this to send a carbon copy to a second recipient
|&bcc use this to send a blind carbon copy to a second recipient, the main recipient will not see the bcc: email address
|256 The maximum number of characters allowed in a mailto string is 256
html mailto sequence example :
<a href="mailto:email@example.com, firstname.lastname@example.org?subject=more free email@example.comfirstname.lastname@example.org">
Click Here to see this in action!
the trouble with mailto
In the majority of cases mailto will work just fine but for a very small number of user's in won't work at all or can be unpredictable.
The small number that mailto does not work for is declining with the advent of modern email software being bundled with pc's and other software and if every email is critical to you, you will need to find a server that offers cgi formmail.
Probably the most common reason for mailto to fail is that the user does not have their email set up properly and you can't do a whole lot about that. I use the Ultimate Marketing Center for my hosting provider and included with the service is a couple different variety of forms. You don't need to know how to program or work with cgi, it will all be installed for you. Its a great deal if you market goods and services on the interent. To see how these contact forms are created you can watch a video
- Video 1
- Video 2
about Contact Forms, check out the Ultimate Marketing Center for more details.
I'm not an expert on creating forms, but I found a tutorial that might help you get started
html mailto forms
Another way to use mailto is with html forms, the main advantage of forms is that you can collect more information about the user than they would normally volunteer, for example you can ask specific questions and all the user has to do to answer your questions is simply click on an input checkbox before clicking send
below is an example html source code for setting up mailto in a form
<FORM method="post" action="mailto:email@example.com" enctype="text/plain">
<INPUT TYPE="text" NAME="email">
<INPUT TYPE="hidden" NAME="subject" VALUE="web_monitor">
<INPUT TYPE="text" NAME="subject">
(rest of form content)
the method should be post and the encrypt type should be text/plain
input name="email" and input name="subject" are special tags because they control the way the headers look in your email inbox input name="email" is the from: and subject is, of course the subject
As you may have noticed there are two subject tags in the example html source code above, one text and one hidden
using the html form code above, emails arriving in your inbox should look like this example
FROM: firstname.lastname@example.org SUBJECT: web_monitor, users subject
The web_monitor subject prefix will allow you to clearly see, at a glance that the email has been sent from your website