获取将一封电子邮件发送到多个文件名的正确功能


Get the right function to send one email to multiple filenames

我有一个代码可以为电子邮件准备文件名,但我想知道是否有人能帮助我获得将一封电子邮件发送到多个文件名的正确功能。

这是我目前掌握的代码。

 <?php    
    SELECT filename FROM feedback;          
    //you fill the $emails with all the names from the file      
    foreach ($filenames as $filename){     
    //splitting the string, and take all the characters before the .pdf     
    $filename = substr($filename, 0, strrpos($filename, '.pdf'))+"@email.ulster.ac.uk";     
    }
?>

好吧,无论你试图通过向根据文件名构建的地址发送电子邮件,都只需将其发送给多个接收者:

mail('user1@foo.bar; user2@foo.bar', 'topic', 'text');