So I have a system in which you can add members to your group and the email seems to send completely fine and has all the information but I receive an error which states that $body is an undefined variable, any suggestions?
<?php //check member Email matches
$addmember = $link->query("SELECT Email FROM logins WHERE Email ='$memberemail'")->fetch_assoc()['Email'];
$to = $addmember;
$subject = "Becoming part of $leaguename";
$body.="So you want to become part of $leaguename?".PHP_EOL;
$body.="Please click the link below to join!".PHP_EOL;
$body.="http://www.wesbitelink.dev/verify.php?memberemail=$memberemail;".PHP_EOL;
$headers = "From: localhost";
mail($to, $subject, $body, $headers);
header("location: addanothermember.php");
?>
The error message I receive is:
Notice: Undefined variable: body