drj14664
2015-11-20 11:47使用php邮件向多封电子邮件发送消息
I have a table below in MYSQL
Mmeber_Email---------------Member_Name------Data---
mike01@yahoo.com -------- Mike ---------- 100 ------
jacknick@gmail.com --------Jack -----------50 ----
jillwag@hotmail.com -------Jill ---------- 75 ------
jnash@gmail.com -------- John ---------- 10 ------
Now, I have managed to extract the data from the database using PHP. but i don't know how to email the data of each member on their respective email using PHP Mail function. How should i tackle the problem of sending emails to multiple recipients using the PHP mail function below i.e Mike Should get the email containing the message 100, Jack 5 and so on..
<?php
$to = "somebody@example.com";
$subject = "My subject";
$txt = //data extracted from database using a common query comes here
$headers = "From: webmaster@example.com";
mail($to,$subject,$txt,$headers);
?>
- 点赞
- 回答
- 收藏
- 复制链接分享
2条回答
为你推荐
- 向PHP发送一百万封电子邮件给一百万用户
- smtp
- send
- php
- 1个回答
- 如何使用PHP通过ZOHO api发送电子邮件?
- rest
- api
- php
- 1个回答
- php邮件功能发送多封电子邮件
- php
- 1个回答
- 发送多封电子邮件失败的php邮件[重复]
- html
- php
- 1个回答
- 在codeigniter php中发送电子邮件后无法显示成功消息
- codeigniter
- php
- 1个回答
换一换