Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am sending an email campaign out to subscribers and I would like to incorporate a Facebook Like and a Tweet Button into my email. Since I cannot use javascript inside emails I was wondering the best way to do this. Here is what I have so far:

Tweet Button

<a title="Share Via Twitter" href="http://twitter.com/intent/tweet?
url=http://my-campaign-url&amp;text=My%20Text%20-%20&amp;via=My Name&amp;">
<img src="/Images/network_icons/tweet-button-small.png" 
style="border:0 none;" alt="Share Via Twitter">

Facebook Like

<a title="Like this on Facebook" href="http://www.facebook.com/plugins/like.
<img src="/Images/network_icons/fblike-button-small.png" style="border: 
0 none;" alt="Like This on Facebook">

Here are a few questions:

How do I pull the subject of the email to be posted along with the content?

Is it possible to pull only an image from the email and have that posted vs the entire email content?

Is there a better way to code the above buttons?

Thanks for the assistance.

share|improve this question
What software you using to send the emails? – Nick Sep 1 '11 at 10:58
I use a CMS to handle the mailing. I build the code in HTML then paste it into their Editor and off it goes – L84 Sep 2 '11 at 0:49
up vote 1 down vote accepted

AFAIK, the Facebook Like buttons are for web pages only. On e-mails you can create share links (and use images as buttons).

The code would be:


<a href="http://www.facebook.com/sharer.php?u=http%3A//my.campaign.url"><img src="http://absolute.path.to/fblike-button-small.png" style="border: 
0 none;" alt="Like This on Facebook"></a>

Facebook sums "shares" to Likes count.


<a href="http://twitter.com/?status=My%20tweet%20http%3A//www.mysite.com"><img src="http://absolute.path.to/tweet-button-small.png" style="border: 
0 none;" alt="Tweet this"></a>


Your website URL and the Twitter message have to be URL encoded for both Facebook and Twitter links. There are tools to help with URL encoding. Click this link to search them in Google:


share|improve this answer
Thanks, I found this last night: addthis.com/get-addthis and this does what you say but a bit easier as a tool => – L84 Sep 2 '11 at 1:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.