views:

463

answers:

4

Hi all,

I sent my code to my friend over Gmail but as you guess, the code is not highlighted in Gmail. Is there solution to highlight code that is sent over Gmail?

+2  A: 

Paste your code to an online (maybe offline) syntax highlighter, like http://tohtml.com/ . Then copy/paste it to gmail & send.

Ahmet Kakıcı
This is good for me but I wish there should be a gmail plugin in gmail labs. Thanks Ahmet...
Firstthumb
+8  A: 

Unless you absolutely have to have the code in the email, I would just put your code on Pastebin and link to the code.

If you must put your code in the email, you could use a GreaseMonkey script such as this C++ highlighter, however that will not work for the person you're sending it to, only you. Another solution is to export your code as HTML (with coloring), and send it to the person as HTML. Try Visual Studio's CopySourceAsHtml plugin if you're using Visual Studio.

Dan Walker
I prefer to use internal application not external link. So generating highlighted html code for sourcecode is the best way.
Firstthumb
A: 

If your language is not available at http://tohtml.com but you use GitHub you can also paste into a (private) gist there - http://gist.github.com/ - then copy&paste back to gmail.

MathiasKegelmann