从数据库中选择电子邮件以将表单信息发送到

时间:2014-04-09 21:44:15

标签: php mysql database email

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

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';

0 个答案:

没有答案