I'm trying to get an email through an input, transmit to the server through Ajax, and server side has a script that uses the PHPMailer class to send an email, and the PHP code without receiving variable works, so the error probably in Ajax
HTML
form id="emailForm">
<label for="campoEmail" class="has-information" hidden="false">Email enviado com sucesso</label>
<input id="campoEmail" class="input-center" placeholder="Digite aqui" type="email" name="email" required="true">
</br>
</br>
<input id="enviar" type="submit">
</form>
Javascript with Jquery
$('#emailForm').submit(function(e){
e.preventDefault();
$.ajax({
type: 'POST',
url: '/email.php',
data: 'email=' + $('#campoEmail').val(),
success:alert("Sucesso")
});
});
});
PHP has been tested separately and is working