views:

61

answers:

4

I like the functionality of Share This, but I only need the "email this" option using my own custom icon. Is there a sensible way to do this?

Thanks!

+1  A: 

The simplest method is a mailto link. This will often open in a desktop client. However, Firefox lets you configure it to use a web service, there are extensions (e.g. ChromeMailer) to do the same in other browsers.

It's a little more complicated if you want to send the email from your server.

Matthew Flaschen
+1  A: 

The simplest is to use JS to populate an A element:

<a href="mailto:[email protected]?body=Message body here.">
Peter Ajtai
Such an element is called an [‘a element’](http://www.w3.org/TR/html401/struct/links.html#edef-A), not an ‘a anchor’ (sorry, purist).
Marcel Korpel
@Marcel, from the DTD: `<!ELEMENT A - - (%inline;)* -(A) -- ` **anchor** `-->`. Sorry, purist...
Matthew Flaschen
@Marcel - Thanks. I must have been trying to decide between `A element` and `anchor` and that came out.
Peter Ajtai
@Peter, you're not the only one, nearly everyone calls that "anchor". Even the earliest HTML manuals I dig up refer to <A> as the "anchor element"...
code4life
@code, yeah, the very document @Marcel linked calls it an "anchor."
Matthew Flaschen
Ahh... right from wikipedia: http://en.wikipedia.org/wiki/HTML_element#Anchor
code4life
@Matthew: hehe, you're almost right, I read a bit [further in the spec](http://www.w3.org/TR/html401/struct/links.html#idx-anchor-1), which implies that every `a` element *defines* an anchor, if there's at least one of the attributes 'id', 'name' or 'href' (which is the case here). Only when all three are absent, the `a` element doesn't specify an anchor.
Marcel Korpel
@code, I have to admit that I just wanted to write “anchor element”, but then I decided to look in the spec.
Marcel Korpel
A: 
<span class="st_email_button" displayText="Email"></span>

<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"&gt;&lt;/script&gt;
<script type="text/javascript">
        stLight.options({
                publisher:'12345'
        });
</script>

see it here

Zenofo
+2  A: 

Add This email-only option

You can create an email-only popup form. This will not affect other AddThis buttons on the page.

Looks simple enough to me

Eli