有没有关于如何在不使用PHPMailer的情况下通过PHPmail嵌入图像的知识?

有没有关于如何在不使用PHPMailer的情况下通过PHPmail嵌入图像的知识?,php,html,email,header,Php,Html,Email,Header,我更愿意使用我已经拥有的,如果可能的话,只需添加一个图像。以下是我目前的代码: $to = $Email; $subject = "$auth->first_name $auth->last_name left you a comment"; $message = "$auth->first_name $auth->last_name left you a comment: <br /><br /> <a href='http://www.

我更愿意使用我已经拥有的,如果可能的话,只需添加一个图像。以下是我目前的代码:

$to = $Email;
$subject = "$auth->first_name $auth->last_name left you a comment";
$message =  "$auth->first_name $auth->last_name left you a comment: <br /><br /> <a href='http://www.blah.org/Profile.php?id=" . $prof->id . "'>Click here to view</a>";
$from = "blah<noreply@blah.org>";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $from";
mail($to, $subject, $message, $headers);
$to=$Email;
$subject=“$auth->first\u name$auth->last\u name给您留下了评论”;
$message=“$auth->first\u name$auth->last\u name给您留下了一条评论:

”; $from=“诸如此类”; $headers='MIME版本:1.0'。“\r\n”; $headers.='内容类型:文本/html;字符集=iso-8859-1'。“\r\n”; $headers.=“发件人:$From”; 邮件($to、$subject、$message、$headers);
将图像的HTML放在
$message

$message = "Here is my image: <img src='http://www.mysite.com/1.jpg' />";
$message=“这是我的图片:”;

确保使用绝对url(“…”),因为它将从收件人收件箱加载,而不是从您的服务器加载。

将图像的HTML放在您的
$message

$message = "Here is my image: <img src='http://www.mysite.com/1.jpg' />";
$message=“这是我的图片:”;

请确保使用绝对url(“…”),因为它将从收件人收件箱加载,而不是从您的服务器加载。

我已经尝试过了。一旦添加到现有$message的末尾,再添加一条$message.=此时它甚至不会将邮件发送到我的收件箱。有什么我不知道的吗?我试过了。一旦添加到现有$message的末尾,再添加一条$message.=此时它甚至不会将邮件发送到我的收件箱。我有什么遗漏吗?