当我点击以下表单的提交按钮时,它不会向上述电子邮件发送电子邮件。请指导我为什么不工作。
感谢。
<form action="mailto:fahad@inspurate.com" role="form" id="submit-mobile-box" style="color:#FFF;">
<span class="form-group has-failure has-feedback">
<input style=" float: left; margin-right: 4%;" type="text" class="form-control" id="fullName" placeholder="Enter full name" >
</span>
<br>
<br>
<br>
<span class="form-group has-failure has-feedback">
<input style=" float: left;" type="text" class="form-control" id="surname" placeholder="Enter Surname">
</span>
<br>
<br>
<br>
<span class="form-group has-failure has-feedback">
<input style="width: 50%; float: left;" type="text" class="form-control" id="mobileNumber" placeholder="Enter Mobile number">
</span>
<span class="form-group has-failure has-feedback">
<input style="width: 50%; float: left;" type="text" class="form-control" id="landLineNumber" placeholder="Enter Landline number">
</span>
<br>
<br>
<br>
<span class="form-group has-failure has-feedback">
<input style="float: left;" type="text" class="form-control" id="email" placeholder="Enter email">
</span>
<br>
<br>
<br>
<span class="form-group has-failure has-feedback">
<textarea style="float: left;" rows="5" class="form-control" id="pickup" placeholder="Enter Pick up Address"></textarea>
</span>
<br>
<br>
<br>
<br>
<br>
<span class="form-group has-failure has-feedback">
<input style="width: 50%; float: left;" type="text" class="form-control" id="mobileMake" placeholder="Enter Mobile Device Make">
</span>
<span class="form-group has-failure has-feedback">
<input style="width: 50%; float: left;" type="text" class="form-control" id="mobileModel" placeholder="Enter Mobile Device Model">
</span>
<br>
<br>
<br>
<span class="form-group has-failure has-feedback">
<label style="color:#666666;"> Warranty </label>
<input style="color:#666666 !important;" type="radio" name="warranty" value="true"><span style="color:#666666">Yes</span></input>
<input style="color:#666666 !important;" type="radio" name="warranty" value="false"><span style="color:#666666">No</span></input>
</span>
<br>
<br>
<span class="form-group has-failure has-feedback">
<label style="color:#666666;"> Are you looking to buy new phone ? </label>
<input style="color:#666666;" type="radio" name="newPhone" value="true"><span style="color:#666666">Yes</span></input>
<input style="color:#666666;" type="radio" name="newPhone" value="false"><span style="color:#666666">No</span></input>
</span>
<br>
<br>
<span class="form-group has-failure has-feedback">
<label style="color:#666666;"> If Yes, then when ? </label>
<input style="color:#666666;" type="radio" name="when" value="1"><span style="color:#666666">1 month</span></input>
<input style="color:#666666;" type="radio" name="when" value="6"><span style="color:#666666">6 month</span></input>
<input style="color:#666666;" type="radio" name="when" value="1"><span style="color:#666666">12 month</span></input>
</span>
<br>
<br>
<span class="form-group has-failure has-feedback">
<label style="color:#666666;"> Desbcribe the issue your are having with your mobile phone;</label>
<textarea style="width: 100%; float: left;" rows="5" class="form-control" id="mobileIssue" placeholder="Enter Mobile Issue Model"></textarea>
</span>
<br>
<br>
<button class="btn btn-default" onclick="submitMobile();">
<strong style="color:#666666;">
Submit
</strong>
</button>
<p style="float:right;">
<a href="#"></a>
</p>
</form>
答案 0 :(得分:1)
它不会发送电子邮件,因为mailto:protocol只会打开发送表单的用户的电子邮件客户端。您需要一个服务器端进程来发送电子邮件,例如PHP:
$from = "your@email.com";
$to = "destination@email.com";
$subject ="This is an email";
$message = "This is the body of the message";
mail($to, $subject, $message);