I am re-posting this because no one answered my previous post.
I am trying to send emails to multiple recipients with respective pdf files attached. I was successful
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']; ?> </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>
You can't send different attachments to different recipients in one email. You will need to send separate emails.