Php 从数据库中选择要向其发送表单信息的电子邮件

Php 从数据库中选择要向其发送表单信息的电子邮件,php,mysql,database,email,Php,Mysql,Database,Email,我目前正试图通过表单将从用户输入数据收集的信息发送到存储在数据库中的电子邮件地址,我不知道这是否可行。在我将它们发送到我自己的电子邮件的那一刻,作为测试,是否有任何方法可以选择并将信息发送到数据库中我的表中的列中的电子邮件。这是我的密码 require 'mail/class.simple_mail.php'; $mailer = new SimpleMail(); $comments = $_REQUEST['comments']; $time = $_REQUEST['time']; $d

我目前正试图通过表单将从用户输入数据收集的信息发送到存储在数据库中的电子邮件地址,我不知道这是否可行。在我将它们发送到我自己的电子邮件的那一刻,作为测试,是否有任何方法可以选择并将信息发送到数据库中我的表中的列中的电子邮件。这是我的密码

require 'mail/class.simple_mail.php';
$mailer = new SimpleMail();

$comments = $_REQUEST['comments'];
$time = $_REQUEST['time'];
$date = $_REQUEST['date'];
$place = $_REQUEST['place'];


$message = "<strong>This is an email from the bride to you the bridesmaids, here is the information on the next dress fitting<br />".$date." ".$time." ".$place." ".$comments." </strong>";



$send   = $mailer->setTo('targetemail@example.com', 'Your Email')
                 ->setSubject('Dress Fitting')
                 ->setFrom('myemail@myemail.com', 'Domain.com')
                 ->addMailHeader('Reply-To', 'myemail@myemail.com', 'Domain.com')
                 ->addMailHeader('Cc', 'myemail@myemail.com', 'Bill Gates')
                 ->addGenericHeader('Content-Type', 'text/html; charset="utf-8"')
                 ->setMessage($message)
                 ->setWrap(100)
                 ->send();
echo ($send) ? 'Your Email has been sent to your bridesmaids' : 'Could not send email';
require'mail/class.simple_mail.php';
$mailer=新的SimpleEmail();
$comments=$_请求['comments'];
$time=$_请求['time'];
$date=$_请求['date'];
$place=$_请求['place'];
$message=“这是新娘给伴娘的电子邮件,下面是下一次试衣的信息
“$date.”“$time.”“$place.”“$comments.”
”; $send=$mailer->setTo('targetemail@example.com“,”您的电子邮件“) ->setSubject(“连衣裙试衣”) ->设置自('myemail@myemail.com“,”Domain.com“) ->addMailHeader('回复','myemail@myemail.com“,”Domain.com“) ->addMailHeader('Cc','myemail@myemail.com“,”比尔·盖茨“) ->addGenericHeader('Content-Type','text/html;charset=“utf-8”')) ->setMessage($message) ->自动换行(100) ->send(); 回音($send)?'您的电子邮件已发送给您的伴娘:'无法发送电子邮件';
是,这是可能的。使用PHP从MySQL数据库读取是PHP101。网上有1000个教程向你展示了如何操作。好吧@Madbreaks,但我是在编辑代码还是从头开始编写代码?