Question: 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

```

Answer: 
Just before comparing convert the input to lowercase or uppercase. Then have to cases in lowercase or uppercase.

Something like 

```
 switch(days.toLowerCase())
            {
               case 'mon':
                document.write("Today is Monday");
                break;
               case 'tue':
                document.write("Today is Tuesday");

```

So the code works for both the cases.

```
var days='thu'; //or  var days='Thu';
 switch(days.toLowerCase())

```

If you do not want to touch days at all, the below way works. But I dont personally prefer it

```
case 'Mon':
case 'mon':      
document.write("Today is Monday");
break;
case 'Ton':
case 'tue':      
document.write("Today is Tuesday");
break;

```
first you have to convert it into uppercase or lowercase then you can match it 

example for if you used uppercase 

```
switch(days.toUpperCase())
   case 'MON':
                document.write("Today is Monday");
                break;
               case 'TUE':
                document.write("Today is Tuesday");
                break;
               case 'WED':
                document.write("Today is Wednesday");
                break;
               case 'THU':
                document.write("Today is Thursday");
                break;
               case 'FRI':
                document.write("Today is Friday");
                break;
               default:
               document.write("Weekend...!!!");

```

Or you can do it asa well as in lowercase 

```
switch(days.toLowerCase())
   case 'mon':
                document.write("Today is Monday");
                break;
               case 'tue':
                document.write("Today is Tuesday");
                break;
               case 'wed':
                document.write("Today is Wednesday");
                break;
               case 'thu':
                document.write("Today is Thursday");
                break;
               case 'fri':
                document.write("Today is Friday");
                break;
               default:
               document.write("Weekend...!!!");

```