First things first, since the code uses taint checking, (-T), it will need to define a valid (and untainted) ENV{PATH}. In this case, it could be as simple as:
Code:
local $ENV{PATH} = "/usr/sbin";
Second, you've got two ".com"s on the end of the
$to definition.
Third, your
open to sendmail doesn't do any error checking. It's a very good idea to trap any errors that might occur on the
open.
After fixing these issues (of course changing the email addresses to match my own), the code worked just fine.