-1
I have a small problem at the time of connecting the contact form to be sent by email, it is not sending by email and I could not understand the reason for this, follows below the html code with the name contact.html
<form action="sendemail.php" id="main-contact-form" name="contact-form" method="post" >
<div class="row wow fadeInUp" data-wow-duration="1000ms" data-wow-delay="300ms">
<div class="col-sm-12">
<div class="form-group">
<input type="text" name="Nome" class="form-control" placeholder="Nome" required="required">
<p class="help-block">Obrigatorio</p>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<input type="email" name="Email" class="form-control" placeholder="Email" required="required">
<p class="help-block">Obrigatorio</p>
</div>
</div>
</div>
<div class="form-group">
<input type="text" name="Instituição" class="form-control" placeholder="Instituição" >
</div>
<div class="form-group">
<textarea name="message" id="message" class="form-control" rows="4" placeholder="Escreve sua menssagem" required="required"></textarea>
</div>
<div class="form-group">
<button type="submit" class="btn-submit">Enviar</button>
</div>
</form>
Below is the php code with the name sendemail.php
<?php
$name = @trim(stripslashes($_POST['Nome']));
$from = @trim(stripslashes($_POST['Email']));
$subject = @trim(stripslashes($_POST['Instituicao']));
$message = @trim(stripslashes($_POST['message']));
$to = '[email protected]';//replace with your email
$headers = array();
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-type: text/plain; charset=iso-8859-1";
$headers[] = "From: {$name} <{$from}>";
$headers[] = "Reply-To: <{$from}>";
$headers[] = "Subject: {$subject}";
$headers[] = "X-Mailer: PHP/".phpversion();
mail($to, $subject, $message, $headers);
?>
I am well Noob in php per hour, so I’m having this problem, the site is already on the server and I am unable to find the error.
HI Gabriel, where is your application hosted? Depending on where, you should use some additional parameters in the mail function.
– Gildonei