in reply to Small email script not working

$sendmail is undefined, as is $email and $subject

Or if you define them somewhere, they contain the wrong thing

Or something else that $sendmail would print to STDERR

See Email::Send