Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 发送电子邮件至相应的电子邮件地址_Php - Fatal编程技术网

Php 发送电子邮件至相应的电子邮件地址

Php 发送电子邮件至相应的电子邮件地址,php,Php,我通过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. <

我通过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="\&quot;email\&quot;" 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。怎么可能呢?

PHP的邮件功能可以提供帮助:

首先,您需要一个
名称作为输入

<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);
?>

在某些情况下,邮件功能在本地主机上不起作用


更多关于

我想你必须为此在电脑上键入一些代码。或者将一些二进制数字从你的银行帐户移到另一个帐户。只有链接才是答案discouraged@Dagon这可能适用于博客或个人网站的链接,这些链接可能会离线。我无法想象链接到php自己的文档会被阻止。