我已经通过modal.js添加了一个模态框,如bellow。
<div class="modal current" id="ex1" style="position: fixed; top: 50%; left: 50%; margin-top: -217px; margin-left: -235px; z-index: 2; display: block;">
<p>Thank you for adding a new word in the dictionary.
</p><p>Tell your friends</p><input type="\"email\"" placeholder="Enter your friend's email address"><input type="Submit" value="Send" name="Submit"><p><a href="http://verbalage.com/index.php/advertise" target="_blank">Advertise with us</a></p>
现在我想发送电子邮件到电子邮件输入框中的电子邮件ID。怎么可能?
答案 0 :(得分:1)
首先,您需要输入name
<input type="email" name="email" placeholder="Enter your friend's email address">
在php中,使用mail()函数可以实现,例如:
<?php
// receive the email address from form
$to = $_POST['email'];
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
在某些情况下,邮件功能不适用于localhost。
有关php mail
的更多信息答案 1 :(得分:-2)
PHP的邮件功能可以提供帮助:http://php.net/manual/en/function.mail.php