我正在为用户发送电子邮件,我进行查询:
$consulta = mysql_query("SELECT * FROM users WHERE email = '$emailDestinatario'");
if($consulta === FALSE) {
(header('Location: http://l2prime.org/index.php?login=success') xor die(mysql_error()));
} while($row = mysql_fetch_array($consulta))
{
$username = $row['username'];
}
}
然后我有 $body ,它是电子邮件正文消息的变量:
$body = '
<html>
<head>
<title>Recuperação de password.</title>
</head>
<body>
<h3>Dear <?php echo $username?>,</h3>
<p>
<b>Some text here.</b>
</p>
</body>
</html>
';
那是<?php echo $username?>
行不通的,电子邮件到达“亲爱的”,根本没有用户名。有人可以帮我解决这个问题吗?
先感谢您。
最好的问候,马塞洛