in reply to about Net::SMTP

I believe you need to add a second newline after the Subject, like:
$s->datasend("Subject: $subject\n\n");

Some mail clients (maybe most, I dunno) need to see a completely blank line to separate the headers from the message body.

- Matt Riffle