in reply to send contents of a file in mail

but it is not working as expected

Alas, that is an insufficient description of the problem as I am sure on re-reading your post you will agree. You've given no sample data, no sample output, no error messages, no indication of what sendMail() might be or where it has been loaded from. The only possible advice one could give at this point (other than to suggest you provide an SSCCE) is to check everything.


🦛 "It doesn't work" is as useful to a developer as "I'm ill" is to a medic. Try to be specific. SSCCE is best.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.