我有一個簡單的電子郵件表格在PHP中發送表單輸入到電子郵件地址。但是,textarea不包括在內。電話號碼正在發送,只是textarea不是。這是我的表格:PHP的電子郵件表格不發送文本區域
<form id="form1" name="form1" method="post" action="send.php">
<p> <span id="sprytextfield1">Your name:
<label for="name"></label>
<input type="text" name="name" id="name" /></p>
<span class="textfieldRequiredMsg">A value is required.</span></span>
<p><span id="sprytextfield2">
<label for="email">Email address:</label>
<input type="text" name="email" id="email" />
<span class="textfieldRequiredMsg">A value is required.</span></span></p>
<p>
<label for="phone">Phone Number:</label>
<input type="text" name="phone" id="phone" />
</p>
<p><span id="sprytextarea1">
<label for="message">Message</label>
<br />
<textarea name="message" id="message" cols="45" rows="5"></textarea>
<span class="textareaRequiredMsg">A value is required.</span></span></p>
<p>
<input type="submit" name="Submit" id="Submit" value="Submit" />
<br />
</p>
</form>
之後,我對錶單進行了驗證。 這裏的PHP
$name=$_POST[name];
$email=$_POST[email];
$phone=$_POST[phone];
$message=$_POST[message];
$from="From: $name<$email>\r\nReturn-path: $email";
$subject="Message sent using your contact form";
mail("[email protected]", $subject, $from, $phone, $message);
echo "Email sent!";