I think you can just use .=
to concatenate onto the txt
variable, and then move the mail
stuff outside of the loop.
$txt = '';
while ($row = $result->fetch_assoc()) {
$rows = "id: " . $row["user_id"] . " - Name: " . $row["user_phone"] . " " . $row["user_email"];
echo "$rows";
$txt .= $rows . "
";
}
$to = "******@gmail.com";
$subject = "My subject";
$headers = "From: admin@******.com" . "
" .
"CC: ***********@gmail.com";
mail($to, $subject, $txt, $headers);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…