if there are no errors, you don't define the $message variable. To avoid the error, just put the next line before you start checking the form data:

$message = "";