I made these fix to be able to use the multiple attach file.

Using the full filename in that fourth condition didn't work if I had to send a file with a different extension.