【发布时间】:2015-07-29 12:11:42
【问题描述】:
我的电子邮件发送代码
<?php
$to = 'piyu.mulay@gmail.com';
$subject = 'Website Change Request';
$headers = "From: chintamani.mulay@gmail.com \r\n";
$headers .= "CC: chintamani.mulay@gmail.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = '<html><body>';
$message .= '<h1>Hello, World!</h1>';
$message .= '<img src="../1.jpg">';
$message .= '</body></html>';
echo mail($to, $subject, $message, $headers);
?>
当我将链接放入<img src="http://weber-steinach.de/files/339349"> 时效果很好,但是当我将文件路径放入我的 localserver 时,我不会在电子邮件中显示和图像。
【问题讨论】:
-
你不能使用你的本地服务器。收件人将无权访问它。您可以在外部托管它(就像您正在做的那样)或将其作为多部分消息附加。
-
@jonny2k9 能否提供maultipart示例的链接