我有一個關於通過php發送電子郵件的一般性問題。你如何將PHP數組放入郵件的消息部分?如何在電子郵件中添加一個php數組?
下面你可以看到一個簡單的數組,我做了,並試圖把它放在電子郵件中,但這是完全錯誤的,因爲我沒有找到它在互聯網上如何做到這一點(我是一個初學者。 PHP)。
數組:
<?php
$Array[1] = array('qualitypoint', 'technologies', 'India','Hey');
$Array[2] = array('quality', 'tech', 'Ind','He');
$Array[3] = array('q', 't', 'I','H');
?>
的郵件:
<?php
include "index.php";
while($row = $LevAdres->fetch_assoc()) {
$email=null;
$email= $row['Email'];
}
$to = [email protected];
$subject = "Bestelling";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "From: [email protected]" . "\r\n";
$headers .= "Reply-To: [email protected]". "\r\n";
$headers .= "CC: [email protected]\r\n";
$message = "<?php
echo '<table>';
echo '<table>';
for($i=0;$i<=3;$i++)
{
echo "<tr>";
for($j=1;$j<=3;$j++)
{
echo "<td>{$Array[$j][$i]}<td>";
}
echo "</tr>";
}
echo '</table>';
?>";
if (mail($to, $subject, $message, $headers)) {
echo '<p>successfully sent.</p>';
} else {
echo'<p>delivery failed...</p>';
}
?>
This is how the table must look like
請更改電子郵件地址添加到您的電子郵件地址,請。你不斷給我發電子郵件! @Sander Herreman –