Add Gravatar to your web sites using PHP & C#

Gravatar (an abbreviation for globally recognized avatar) is a service for providing globally unique avatars which was created by Tom Preston-Werner. On Gravatar, users can register an account based on their email address, and upload an avatar to be associated with the account. Gravatar plugins are available for popular blogging software; when the user posts a comment on such a blog that requires an e-mail address, the blogging software checks whether that e-mail address has an associated avatar at Gravatar.


function GetAvatar($email)
   $emailMD5 = md5($email);
   $gravatarURL = "" . $emailMD5 . ".jpg";
   $html="<img src='$gravatarURL' />"; return $html;


public string GetAvatar(string Email)
   string emailMd5 = Utilities.Encryption.MD5.ComputeHash(Email.Trim().ToLower()).ToLower();
   string gravatarURL = "" + emailMD5 + ".jpg";
   string html = "<img src='" + $gravatarURL + "' />"; return html;