Fix issue with reading the file for mail sending