So I have a form in which you can ask someone to join your group via email and for some reason it's not sending the emails out, it was working perfectly fine yesterday and now something seems to be broken. This is the form:
<div class="form" style="background: white; box-shadow: 0 0px rgba(0, 0, 0, 0);">
<form id="addmember" action="addingmember.php" method="post" autocomplete="off">
<div class="field-wrap">
<label style="position: relative; color: black;">
Member Email:
</label>
<input type="email" required autocomplete="off" name="memberemail"
style="color: black; padding: 8px; height: 48px;"/>
</div>
<button type="submit" class="button button-block" name="submit">
Submit
</button>
</form>
And this is the addingmember code:
<?php
include '../db_connection.php';
session_start();
$leaguename = $_SESSION['league_name'];
$startdate = $_SESSION['start_date'];
$enddate = $_SESSION['end_date'];
$joincode = $_SESSION['joincode'];
$_SESSION['memberemail'] = $_POST['memberemail'];
$memberemail = $link->escape_string($_POST['memberemail']);
//check member Email matches
$memberemail = $link->query("SELECT Email FROM logins WHERE Email =' " . $_SESSION['memberemail'] . "'")->fetch_assoc()['memberemail'];
$to = $memberemail;
$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.linkhere.com/login/verify.php?memberemail=$memberemail&joincode=$joincode;" . PHP_EOL;
$headers = "From: emailhere";
mail($to, $subject, $body, $headers);
//header("location: addanothermember.php");
?>