我正在尝试发送 php 邮件,但我的 foreach 似乎有错误,因为邮件显示 html .. 这是我的代码:
<form method="post">
<fieldset>
<legend>Contact Form</legend>
<label for="fullname">Votre Nom :
<input id="fullname" name="fullname" type="text" value="nelson" />
</label>
<label for="emailaddress" class="margin">Votre e-mail:
<input id="email" name="email" type="text" value="" />
</label>
<label for="message">Message:<br />
<textarea id="message" name="message" cols="40" rows="8"></textarea>
</label>
<p>
<input id="submit-button" class="button gray stripe" type="submit" name="submit" value="Envoyer le message" />
</p>
</fieldset>
</form>
<?php
foreach ($_POST as $value) {
$value = strip_tags($value);
$value = htmlspecialchars($value);
}
$name = $_POST["fullname"];
$email = "email:" .$_POST["email"];
$message = "Nom: <br/>" .$name. "email:<br/> " .$email. "message: " .$_POST["message"];
$to="email@hotmail.com";
$suject="site internet";
if (isset($_POST['submit'])) {
mail($to, $suject, $message);
echo"mail had been sent";
}
?>
谁能帮帮我