in reply to Re^4: Mime::lite "no data" error again
in thread Mime::lite "no data" error again

There has to be something wrong with your variable $text_mail. Is the attach method you showed in your original post called in the sub sendMail? Or somewhere outside? It could be a scoping issue.

Please insert the following in your program just before the attach and provide the result:

use Data::Dumper; print Dumper(\$text_mail); $msg->attach( ...

This will show exactly what is in $text_mail at the moment you call attach (it will even show hidden control characters should there be any)