Okay so I figured it out. One of the file names had an "," between two words. I have removed this from the file and amended the stored file name in the table and he presto the code works, email template opens with all place holders present and attachments added
Thank you
@theDBguy for all of your help.
Are you able to help me now handle some null values in this code please? Or should I start a new thread? I want to try and handle null values in both the place holders, notes and attachments.