如何在电子邮件标题中显示图像。我在下面试过,它在gmail中没有显示图像。请任何人帮我解决这个问题。
$to = $_REQUEST['userEmail'];
$firstName = $_REQUEST['firstName'];
$lastName = $_REQUEST['lastName'];
$email = $_REQUEST['email'];
$question = $_POST['message'];
$subject = 'Test Email';
$message = "<html><head><img src='http://192.168.1.157/Shop/wp-content/uploads/2016/07/image_nmae.png'/></head>"
. "<body><h1>Visitor Information</h1>"
. "<p>Visitor Information: Fist Name: ".$firstName." Last Name: ".$lastName."</p>"
. "<p>Email: ".$email."</p><p>Question: ".$question."</p></body></html>";
$headers = array('Content-Type: text/html; charset=UTF-8');
$mailSend = wp_mail($to, $subject, $message,$headers);
答案 0 :(得分:0)
这取决于用户Gmail帐户settings,就像在我的Gmail帐户中我关闭了图片呈现一样,它是否允许我加载它们。
将/page.php
标记移到<img>
标记内,在头标记内显示图像不是一个好习惯。
如果它不起作用,请将其写在<body>
文件中。
functions.php