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.

  • What software you using to send the emails?
    – Nick
    Commented Sep 1, 2011 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
    Commented Sep 2, 2011 at 0:49

1 Answer 1


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:


  • Thanks, I found this last night: addthis.com/get-addthis and this does what you say but a bit easier as a tool =>
    – L84
    Commented Sep 2, 2011 at 1:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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