We set a global variable for the File Name at the beginning of the job and then at the end we use the global varialbe as a link to the file that we put in the email. Keeping the files on the network is more secure. However, the same solutions would work for attachements.
Below is the full value of the FileName global variable:
"\\\\FILESERVER\\Data\\EXPERIAN\\OUT\\TRIGGER\\" + TalendDate.formatDate("yyyy",TalendDate.getCurrentDate()) + "\\" + TalendDate.formatDate("yyyyMM",TalendDate.getCurrentDate()) + "\\EXP" + TalendDate.formatDate("MMddyyyyHHmmss",TalendDate.getCurrentDate())+ ".TXT"
Below is the tSendMail, the Job, and the tSetGlobalVar where the above code is placed to create the dymanic file at the beginning.
I forgot to mention that you also need to use the same global variable FileName for the path of the output file.
Hope that helps.