【发布时间】:2021-12-21 10:07:03
【问题描述】:
我不太擅长 PHP 和编程,但我仍在尝试以各种可能的方式学习它。我需要专家的帮助。我发送电子邮件的代码如下。我可以发送电子邮件,但问题是,图片未显示在电子邮件正文中,并且显示十字符号。任何可能的想法和建议表示赞赏。
<?php
function send_email($from, $to, $subject, $message){
$headers = "From: ".$from."\r\n";
$headers .= "Return-Path: ".$from."\r\n";
$headers .= "CC: abc@gmail.com\r\n , xyz@gmail.com\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="LMN@gmail.com";
$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);
?>
【问题讨论】:
标签: php