开发者

How can I email a long list of emails in my database?

开发者 https://www.devze.com 2023-02-03 06:39 出处:网络
I have this database table that contains emails like 300 records, emails{email,name,join_date); and I want to email all of them开发者_运维问答 something, how could I do this with php and mysql? tha

I have this database table that contains emails like 300 records,

emails{email,name,join_date);

and I want to email all of them开发者_运维问答 something, how could I do this with php and mysql? thanks!


$myEmailMessage = "";
$sql=mysql_query("SELECT * FROM emails");
while($info=mysql_fetch_assoc($sql)){
    mail($info['email'], 'My Email Title', $myEmailMessage);
}

Now you just need to set $myEmailMessage to whatever you want to send to your users.

If you need more advanced emails (html, attachments, etc), you can take a look here

0

精彩评论

暂无评论...
验证码 换一张
取 消