0
我無法設置PHP表單。這是我第一次嘗試這樣做。我有表格提交併發送到我的電子郵件。但我收到2封電子郵件。php電子郵件表格問題
是不是彪說(未知發件人)????當然不是。
該圖像它表明你只有一種形式提交後英寸它發送一封空白電子郵件,另一封則帶有文本。但只有消息。怎麼了?
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$to = "[email protected]";
$subject = "New Message";
mail ($to, $subject, $message, "From: " . $name);
echo "Your Message has been sent";
?>
<form id="contactform" name="contact" method="post" action="#">
<div class="row">
<label for="name">Your Name<span class="req">*</span></label>
<input type="text" name="name" id="name" class="text" tabindex="1" placeholder="enter name" required>
</div>
<br>
<div class="row">
<label for="email">E-mail Address<span class="req">*</span></label>
<input type="email" name="email" id="email" class="text" tabindex="2" placeholder="[email protected]" required>
</div>
<br>
<div class="row">
<label for="subject">Subject<span class="req">*</span></label>
<input type="text" name="subject" id="subject" class="text" tabindex="3" placeholder="subject title" required>
</div>
<br>
<div class="row">
<label for="message">Message<span class="req">*</span></label>
<textarea name="message" id="message" class="textarea" tabindex="4" required></textarea>
</div>
<br>
<div class="row">
<input type="submit" name="submit" value="Send Message" id="submit" />
</div>
</form>
http://stackoverflow.com/questions/11606394/unknown-sender-php-code-inside的可能重複 – Karo