回显<img>标签并通过电子邮件+ php发送代码

I have a php variable which contain the whole source code of image.What I want is to echo the tag with its attributes src,height & width and send the source code of image through mail (i.e ).

$imagename = abc.jpg;
$concatpath = SITE_URL."/uploads/affiliatesAdv/".$imagename;
$imagesrc = '<a href="'.SITE_URL.'"><img src="'.$concatpath.'" height="200px" width="200px"></a>';

Now when I echo $imagesrc it displays the image. How can I show the source code instead?

Try this,

echo "<pre>";
echo $imagesrc;
echo "</pre>";

You need to use html encoding.

Some thing like this

<img src="abc.jpg"/> 

to

&lt;img src=&quot;abc.jpg&quot;/&gt;

See the reference.

You can try this site to do it online..