BLOG.KNOWN

Wednesday, November 11, 2009

Add an image to your email signature that does not add the annoying little attachment.

Like to have a funky email signature with an image but hate those little image001.jpg files? You just need to create the equivalent code and paste it into your HTML. Easy peasy.

Run the following code in a PHP page

<?

$imageSource = 'imagefile.jpg';

if (file_exists($imageSource)) {
    exit(base64_encode(file_get_contents($imageSource)));
    }
    else {
        echo "Could not access file";
        }
   
?>

then copy the output into into the HTML like so:

<img src="data:image/jpeg;base64,<image code here>" width="150" height="100" alt="Image alt text" />

Posted via web from blog.known

posted by Brad Down at 11/11/2009 01:11:00 PM      

0 Comments:

Post a Comment

<< Home