通过php发送的电子邮件中未加载图像
我已经为邮件发送选项提供了完整的图像路径。图像在浏览器中加载,但不在邮件中加载。我使用了PHP邮件功能。在这个问题上,任何人都可以帮助我。?我已将CSP登录用于浏览器凭据 我的代码如下所示:通过php发送的电子邮件中未加载图像,php,phpmailer,Php,Phpmailer,我已经为邮件发送选项提供了完整的图像路径。图像在浏览器中加载,但不在邮件中加载。我使用了PHP邮件功能。在这个问题上,任何人都可以帮助我。?我已将CSP登录用于浏览器凭据 我的代码如下所示: <?php $NewMsg .="<p><img src='http://chradm18.gcsc.att.com/itmsmaps/images/Banner.png' alt='' style='width:800px;height:50px'></p>";
<?php
$NewMsg .="<p><img src='http://chradm18.gcsc.att.com/itmsmaps/images/Banner.png' alt='' style='width:800px;height:50px'></p>";
$to = "abc.intl.com";
$subject="ITMS MAPS";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: ITMS MAPS' . "\r\n";
mail($to, $subject, $NewMsg, $headers);
?>
考虑使用类似SendGrid的SMTP服务发送电子邮件。这些服务提供了许多额外的方便性和功能性 一些本地ISP会屏蔽端口25(SMTP),我发现,与其花上几个小时试图找出发送电子邮件的每一个新问题,不如使用SendGrid这样的服务更容易、更可靠地确保我的电子邮件能够送达
我在这里看不到您的代码。别忘了使用绝对路径,如:我使用了图像的完整路径,如。。在某些服务器上,它工作正常。。在某些服务器中,它没有加载。。我已授予所有文件权限。对不起,你运气不好。今天是“每个人都把他们的魔法水晶球送到商店进行维护日”,所以没有人能读懂你的想法,看看你的代码是什么样子。下周再试一次。
<?php
require 'vendor/sendgrid-php.php';
$sendgrid = new SendGrid("username", "password", array("turn_off_ssl_verification" => true));
$email = new SendGrid\Email();
$email->addTo("hello@world.com")->
setFrom("me@world.com")->
setSubject('Test Email Image')->
setHtml('<img src='http://chradm18.gcsc.att.com/itmsmaps/images/Banner.png' alt='' style='width:800px;height:50px'>')->
addHeader('X-Sent-Using', 'SendGrid-API')->
addHeader('X-Transport', 'web');
$response = $sendgrid->send($email);
var_dump($response);
?>