我认为这是在电子邮件签名中使用企业标志的一种方式,而不必担心电子邮件客户端会阻止图像。
很多人都做过这个: http://pgl.yoyo.org/img2html/ 是其中一个例子。
注:此网站可以将图片转换为HTML代码。<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot">
最后警告……如果您的电子邮件签名确实破裂并以代码形式出现……请注意顶部链接的默认值为“屁股”,因此……一些客户可能会认为这是冒犯性的。也许将其更改为公司名称。并记住,为此表格图像创建链接将需要(a)一段时间和(b)大幅度膨胀该代码,这是第二次。
我建议不要尝试这种技巧。
在处理电子邮件时,一个简单的规则是先问一下:“垃圾邮件发送者是否使用了同样的技术?”如果答案是肯定的,那么你可以确定ISP正在使用过滤器来拦截包含此技术的垃圾邮件。
在欺骗图像显示方面,无论是使用base64技巧还是像素divs,这些技术都被垃圾邮件发送者使用了多年,并可能损害您的发送声誉。
如果涉及的公司与收件人有良好的联系,他们将很乐意显示图像。许多客户端(如gmail)会在您回复或添加到联系人后启用图像。此外,使用DKIM等技术签署您的标头,使用值得信赖的第三方发件人,或支付ReturnPath认证费用可以提高您的声誉,从而足以覆盖大多数主要ISP的图像阻止。
终于完成了一个PHP、CSS和HTML函数
最终这种方法应该被视为Jpeg和Png转换为Div。
实现这个方法的步骤是创建一个由HTML元素组成的网格,为每个值设置RGB背景颜色。
希望它能帮助到任何来到这里的人,我最初来到这里只找到了Base64转换,没有原始HTML和CSS。
<?php
// Convert Images to RAW HTML for Bypassing Email Protection, Project by Woke World 2021
// image2div($imagePath, $type, $scale);
echo image2div("test.png","png", 5);
// Custom Function by Woke World @ GitHub
function image2div($imagePath, $type, $scale)
{
if ($type == "png")
{
$resource = imagecreatefrompng('test.png');
}
else
{
$resource = imagecreatefromjpeg('test.jpg');
}
$width = imagesx($resource);
$height = imagesy($resource);
$html_start_1 = '
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
</head>
<body>
<div style="display: grid;';
$cols = 'grid-template-columns: ';
$widths = 1;
while($widths <= $width)
{
$cols .= "1fr ";
$widths++;
}
$cols .= "; ";
$rows = 'grid-template-rows: ';
$heights = 1;
while($heights <= $height)
{
$rows .= "1fr ";
$heights++;
}
$rows .= "; ";
$html_start_2 = '
grid-gap: 0px;
padding: 0px;
border:0px;
height: '.$height*$scale.'px;
width:'.$width*$scale.'px;
">';
$blocks = '';
$html_end = '
</div></body></html>';
for($y = 0; $y < $height; $y++) {
for($x = 0; $x < $width; $x++) {
$color = imagecolorat($resource, $x, $y);
$color_rgb = imagecolorsforindex($resource, $color);
$red = $color_rgb["red"];
$green = $color_rgb["green"];
$blue = $color_rgb["blue"];
$alpha = $color_rgb["alpha"];
$blocks .= '<div style="background-color: rgb('.$red.','.$green.','.$blue.'); margin:-1px;"></div>';
}
}
$build = $html_start_1.$cols.$rows.$html_start_2.$blocks.$html_end;
return $build;
}
?>
尝试转换为html/css。它比base64更紧凑,虽然我还没有尝试过,但应该可以工作。它使用css创建图像而不需要任何外部内容。不要关注顶部,那是执行所有工作的代码所在的位置。请注意底部。https://codepen.io/blazeeboy/pen/bCaLE
no code. just something I have to do to get the post online.