Reply
Old 02-24-2008, 05:44 PM mailto in html
complete's Avatar
Novice Talker

Posts: 11
Trades: 0
I am trying to use the tag "mailto" in an HTML file to prompt the user to email me. Specifically, I want to have the subject and the body of the email message already filled in when the user sends me the email.

So far, I have managed to have a hyperlink where the body is already filled in:
HTML Code:
<a href="mailto::username@gmail.com?body='test'">this works</a>
I have also managed to have a hyperlink where the subject line is already filled in:

HTML Code:
<a href="mailto:usernamegmail.com?subject='the subject'">this works too</a>
But I have yet to figure out how do combine the two:
HTML Code:
<a href="mailto::username@gmail.com?subject='the subject and
the body'?body='test'">help</a>
Does anyone know how to do this?
complete is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 02-24-2008, 06:31 PM Re: mailto in html
chrishirst's Avatar
Super Moderator

Posts: 31,016
Location: Blackpool. UK
Trades: 0
can't be done with HTML

some server side code is required
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Code Samples | Crowded Nightclub? | Random Ramblings
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-24-2008, 06:32 PM Re: mailto in html
tripy's Avatar
Do not try this at home!

Posts: 3,600
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
ok, to start, just a friendly (we are not harsh, here) explanation:
There is no "tags" in html.

You have an "a" node, or element, with an "href" attribute.
I may look like picnitting, but if we all use the same names for the same things, we will understand each others better.

Secondly, I get that you are not very used at web page creation.
No offense, we all started somewhere...

an URL, placed in a href attribute can be composed of several segments.
There are:
訊he protocol (http://, ftp://, file://)
訊he subdomain (www)
訊he domain (whatever)
訊he extension (.com, .org. .net)
訊he port (:80)
訊he pathname (/page/1.hml)
訊he search (?a=1&b=2)

In your case, you want to compose a "search" element into your href attribute.
The fact is, that the ? character is used to delimit the start of the search element.
Every subsequent key=value pairs must be separated by ampersand (&).
So, in your case, you need to use
Code:
<a href="mailto::username@gmail.com?subject='the subject and
the body'&body='test'">help</a>
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-25-2008, 11:24 AM Re: mailto in html
GeekGal's Avatar
Super Talker

Posts: 115
Name: Amber
Location: Mississippi
Trades: 0
Quote:
Originally Posted by tripy View Post
ok, to start, just a friendly (we are not harsh, here) explanation:
There is no "tags" in html.
Now I am very confused. I am just starting out with learning html, and maybe I have somehow misunderstood them, but every html book and website that I have ever seen calls start and end tags.........."start and end tags." Elements represent headings, paragraphs, hypertext links, lists, embedded media, and a variety of other structures.
GeekGal is offline
Reply With Quote
View Public Profile Visit GeekGal's homepage!
 
Old 02-25-2008, 12:24 PM Re: mailto in html
tripy's Avatar
Do not try this at home!

Posts: 3,600
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
well, it seems (to me) that the definition evolved in a relatively short span.
That, and as I tend to relate html to xml (my job), I may have a more "scolar" view over it.

For my, a heading is a <h?> element, or node and attributes (say with me: "there are no alt node on an img element..." ).
An element in a HTML way of representing it, a node in the DOM document tree (which is an xml tree, by the way).

If you take a look at the w3c defintion of html (say, 4.01) http://www.w3.org/TR/WCAG10-HTML-TECHS/#html-index you will see that there are no reference to any tags. But only elements.

let me just finish by saying that everything is relative, and you should not bound yourself to one strict definition.
My paragraph above was intended to be more informative that formal, sorry if it sorted out like that.

If your book talk about tags, so be it, but take in account that a more recent publication might talk about elements or nodes, and that in this case, they are the same thing.
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 02-25-2008 at 12:26 PM..
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-25-2008, 12:26 PM Re: mailto in html
chrishirst's Avatar
Super Moderator

Posts: 31,016
Location: Blackpool. UK
Trades: 0
What Thierry is referring to is the fact that "mailto:" is NOT a tag.

It is a value for the href attribute of <a>nchor elements.

A "tag" refers to either the start or end delimiter for an element.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Code Samples | Crowded Nightclub? | Random Ramblings

Last edited by chrishirst; 02-25-2008 at 12:27 PM.. Reason: spelling and grammar corrected
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-25-2008, 01:03 PM Re: mailto in html
GeekGal's Avatar
Super Talker

Posts: 115
Name: Amber
Location: Mississippi
Trades: 0
Ok.....I think I see what you guys mean. Thanks for explaining that!
GeekGal is offline
Reply With Quote
View Public Profile Visit GeekGal's homepage!
 
Old 02-25-2008, 01:13 PM Re: mailto in html
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
I believe I have figured out why you are so confused tripy. http://www.w3.org/TR/html401/index/elements.html as you can see there the elements, such as h1 (the header 1 element) starts with a <h1> tag and ends with a </h1> tag. http://www.w3.org/html/wg/html5/#elements that there talking about the elements (again, h1 not <h1>) speaks about the nodes in DOM which represent the elements, not the elements as nodes themself. So yes, HTML has elements, but not <h1> is not an element, it is a tag that represents the element to the browser.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 02-25-2008, 01:57 PM Re: mailto in html
tripy's Avatar
Do not try this at home!

Posts: 3,600
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
I believe I have figured out why you are so confused tripy.
I am confused !???
I did not knew.


You know, I will not argue, because it's something too relative, in the end.
It reminds me of Magritte's paint "ceci n'est pas une pipe" (This is not a pipe) which represent a pipe. Meaning that a picture of a pipe is not a pipe.
http://en.wikipedia.org/wiki/The_Treachery_of_Images

I'll just stay to my ground, considering that there are no tags (as for my native language, French, a "tag" relate to something that you add to describe more in detail something else. Close to a label, I believe, in English).
In that view, I compare a tag to a metadata which is attached to something, and in my case, the html element.
This is how all my colleagues both at my work place and over the net are referring to them and it's all I need.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-25-2008, 02:09 PM Re: mailto in html
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
The tags are the labels though. The tag labels/marks how the browser should display or interact with something. The tag <h1> marks that everything after that should be displayed big and bold. The </h1> tag tells it that it should stop displaying things big and bold. The <a> tag indicates that all the things after it are linked to the area the the hypertext reference (href) points to, and that selecting any of them should be rendered as opening that thing that it points to.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 02-25-2008, 03:33 PM Re: mailto in html
tripy's Avatar
Do not try this at home!

Posts: 3,600
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
I'm not going to say "ok", because I don't share your view upon that.
For me, it's a DOM document, with all it's node from the start. At the moment the server sent it.
You consider it's a description of the representation the browser should create.

I don't say you are wrong, but it's relative, and from my angle, it's an XML (well, SGML in fact) tree from the start.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-25-2008, 03:33 PM Re: mailto in html
GeekGal's Avatar
Super Talker

Posts: 115
Name: Amber
Location: Mississippi
Trades: 0
Quote:
Originally Posted by tripy View Post
You know, I will not argue, because it's something too relative, in the end.
It reminds me of Magritte's paint "ceci n'est pas une pipe" (This is not a pipe) which represent a pipe. Meaning that a picture of a pipe is not a pipe.
http://en.wikipedia.org/wiki/The_Treachery_of_Images
That is funny! I have done quite a few trompe l'oeil paintings myself. They really can make you believe that something is there when it's not.

This is really not worth arguing over, but just to add to the discussion, here's how wikipedia defines the tags and elements.

Tags and Elements

GeekGal is offline
Reply With Quote
View Public Profile Visit GeekGal's homepage!
 
Old 02-25-2008, 05:46 PM Re: mailto in html
tripy's Avatar
Do not try this at home!

Posts: 3,600
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0

I stand corrected, then.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to mailto in html
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13725 seconds with 13 queries