I've used blat, and I would recommend using a module such as
Mail::Sender instead. We were using blat through a CGI and blat wouldn't always terminate correctly, and blats would eventually build up and slow/crash the server.
Mail::Sender doesn't make you create a temporary file, which is more convenient(at least for me).
If you are forced to use blat, does
$filename contain the full windows path(ie. c:\temp\msg.txt). If not, I think that could be the reason that it isn't finding it, because blat may not be looking in the same directories as perl does.