me he dado cuenta de tu error mira :
deberias validar los datos antes de realizar lo siguiente
$email = trim(strip_tags(addslashes($_POST['email'])));
$name = trim(strip_tags(addslashes($_POST['name'])));
$phone = trim(strip_tags(addslashes($_POST['phone'])));
ya que si algun dato viene vacio te va a dar indefinida como te sucede
Código PHP:
Ver originalif(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['phone'])) {
// aqui puedes ver el error
// if(empty($_POST['phone'])){echo'introduce el telefono';}
// if(empty($_POST['name'])){echo'introduce el nombre';}
// if(empty($_POST['email'])){echo'introduce el email';}
echo 'rellena todos los datos';
}
else
{
// continuas con el script
}