Hello, I wonder if someone can help me with this task:

I have hundreds of PDF files in a folder, each of them with a name starting with "A", or "N" or "R". I need to email these files to the same email address with the following criteria:

1. max. number of attachments per email is 9
2. files with a name starting with "A" should be emailed together
3. files with a name starting with "N" should be emailed together
4. files with a name starting with "R" should be emailed together

so if say I have 40 files all starting with letter "A", 9 of them should be attached to one email, and after the 4th email (4*9=36), there would be 4 files left to be sent and these 4 should be attached to an email

the title of each email should reflect the letter and number of attachments in each email, i.e. I have 40 files starting with letter "A", 12 files starting with letter "N" and 23 files starting with letter "R", the title field of the emails should show sth like:
A batch 1 with 9 attachements
A batch 2 with 9 attachements
A batch 3 with 9 attachements
A batch 4 with 9 attachements
A batch 5 with 4 attachements

N batch 1 with 9 attachements
N batch 2 with 3 attachements

R batch 1 with 9 attachements
R batch 2 with 9 attachements
R batch 3 with 5 attachements

thanks