So, first, I would solid list of from and to. You said 1st sender is 1-10, 2nd sender is 11-20, but said there is only 10 senders and 300 recipients, so the math isn’t adding up.
regardless, I would restructure your excel file for column A is from, column B is to.
the file should have the whole list:
Sender 1 to recipient 1
sender 1 to recipient 2
sender 2 to recipient 3
etc
if it’s not already this way, I’m sure you can figure out how to make it this way in Excel. If it’s every X# of recepients like you said, sender -1 has the first 10, sender 2 has the next 10, then we can do that pretty easily. What PAD probably won’t do is use colors to differentiate different numbers of recipients. So, if send 1 has 1-9, and 2 has 10-12, we need the sender (col A), and recipient (Col b) to get this to work. I am going to assume that the numbers can change, and we will use the sender (col A), and recipient (Col b) method because this will work for both scenarios.
Now, each row is a record.
launch excel
Get first free row
create list %Recipients%
Set variable %SendEmail% to 0 ‘this will be a boolean, 0=False and 1=True. If true, we will send the email.
Loop 2 to %FirstFreeRow - 1%
read from Excel A & %Loopindex% to %Sender%
Read from Excel B & %LoopIndex% to %Recipient%
Add %Recipient% to list %Recipients%
Read from Excel A & %LoopIndex% to %NextSender%
If %Sender% = %NextSender%
Next (Loop)
Else ‘Sender does not equal NextSender
Send Email where from is %Sender% and to is %Recipients% (the list)
Clear list %Recipients% ‘clear the list for the next sender
End(IF)
End(loop)
good luck