我對PHP和編程不太好,但我仍然試圖以各種可能的方式學習它。我需要專家的幫助。我的代碼發送電子郵件如下。我可以發送電子郵件,但問題是,圖片沒有顯示在電子郵件正文中,並且顯示交叉符號。任何可能的想法和建議表示讚賞。在電子郵件正文中添加圖片
<?php
function send_email($from, $to, $subject, $message){
$headers = "From: ".$from."\r\n";
$headers .= "Return-Path: ".$from."\r\n";
$headers .= "CC: [email protected]\r\n , [email protected]\r\n";
$headers .= "BCC: \r\n";
//set content type to HTML
$headers .= "Content-type: text/html\r\n";
if (mail($to,$subject,$message,$headers))
{
header("location:contact-us.php?msg=msgsent");
}
else
{
header("location:contact-us.php?msg=notsent");
}
}
//Function ends here
$from_email="";
$to_email="[email protected]";
$message.="<html><body background='images/bg11.jpg'>";
$message.="<p style=' color: #006789;'>Dear Team,</p> ";
$message.= "<p style=' color: #006789;'>You have received a feedback from $name & below are the details!!! </p>";
$message.= "<img src=images/c22.jpg>";
$message.="</body></html> ";
send_email(from_email,$to_email,$subject,$message);
?>
感謝哥哥它爲我工作。而且它也很容易。 – A1Nasir