我发送到电子邮件的位置在此表单上?
<!--Start Contact form -->
<form action="email/" method="post" name="enq" target="_blank" onsubmit="return validation();">
<fieldset>
<input type="text" name="name" id="name" value="" class="input-block-level" placeholder="Name" />
<input type="text" name="email" id="email" value="" class="input-block-level" placeholder="Email" />
<textarea rows="11" name="message" id="message" class="input-block-level" placeholder="Comments"></textarea>
<div class="actions">
<input type="submit" value="Send Your Message" name="submit" id="submitButton" class="btn btn-info pull-right" title="Click here to submit your message!" />
</div>
</fieldset>
</form>
<!--End Contact form -->
答案 0 :(得分:2)
您可以使用PHP内置mail()
函数以纯文本格式或格式化HTML从PHP应用程序动态向一个或多个收件人发送电子邮件。
mail()函数的基本语法如下;
mail(to, subject, message, headers, parameters)
从php发送电子邮件的最简单方法
<?php
$to = 'xyz@somedomain.com';
$subject = 'This is subject';
$message = 'This is email message';
$from = 'sendermailadd@email.com';
// Sending email
if(mail($to, $subject, $message)){
echo 'Your mail has been sent successfully.';
} else{
echo 'Unable to send email. Please try again.';
}
?>
有关详细说明,请参阅tutorialspoint.com
请注意,PHP mail()函数是PHP核心的一部分,但您需要在您的计算机上设置一个邮件服务器,以使其真正起作用。
如何配置XAMPP以从localhost Read From here
发送邮件