我无法弄清楚为什么某些 php 在我正在尝试构建的 HTMl 电子邮件中无法正确呈现。代码(大部分 html 元素已被删除):
$messaget = "
<html>
<head>
<title>Your Loan Information</title>
<style type=text/css>
table {border: 0px solid white}
#top {width:590px; margin-left:5px;}
#foot {width:540px; margin-left:10px;}
#left {width:560px; margin-left:20px;}
h1 {margin-left:0px; }
body,td,th {
font-family:Arial, Helvetica, sans-serif;
font-size: 13px;
}
td, tr {border: 0}
</style>
</head>
<body>
<p>Thank you, $custfirst $custlast
<br/>Customer Id: $custid,</p>
<h3>What we have:</h3>
<strong>What We Still Need: </strong><br/>
foreach ($needed as &$value) {
$value<br/>
}'
</body>
</html>
第一个变量,谢谢你,$custfirst $custlast,正在工作。当我发送电子邮件时,我看到“谢谢你,John Smith”
但
foreach ($needed as &$value) {
$value<br/>
}
不执行 php,而是直接显示“foreach ($needed as &$value) { $value
}” 谁能帮我弄清楚为什么?