Multiple sending of email with attachment - repost

烈酒焚心 提交于 2019-12-01 14:49:16

You can't send different attachments to different recipients in one email. You will need to send separate emails.

I think your problem can be solved, just by using a calling a function check below tutorial link

Check This

For this use while loop, for retriving the pdf file name, and email of sender and call the function

if (sendEmail("From Name", "from.email@yours.probably", "emailwhere@itgoes.to", "Email Subject", $msg,$_FILES['Attachment Name'])) {
echo "Email sent"; }

For Memory Limit reached,it depends on your email server, even php can send attachement of 100MB too..May be below link will help

Click here

hope it works!

    <?php 
    $i = 0;
      while($view = mysqli_fetch_array($result)){ 
        $i++; ?>
        <tr>
          <td>
            <label><?php echo $i . ". " . $view['name']; ?>&nbsp</label>
          </td>
          <td>
            <input type="text" name="receiverEmail<?php echo $i; ?>" id="receiverEmail<?php echo $i; ?>" value="<?php echo $view['email'] ?>" readonly style="width: 300px">
          </td>
          <td>
            <input type="file" name="receiverFile<?php echo $i; ?>" id="receiverFile<?php echo $i; ?>">
          </td>
        </tr>
        <tr style="height: 5px"></tr>


  <?php }?>
        <tr style="height: 15px"></tr>
        <tr>
          <td></td>
          <td></td>
          <td style="float: right">
            <input type="submit" name="submit" id="submit">
          </td>
        </tr>
</form>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!