1

Hey guys im hosting my web page in godaddy and im trying to use a form to send an email with php, i got a boostrap template where they wrote the form and php code (so the problem is not in the code).

<form action="sendemail.php" method="POST" id="main-contact-form" name="contact-form">
            <div class="row  wow fadeInUp" data-wow-duration="600ms" data-wow-delay="150ms">
              <div class="col-sm-6">
                <div class="form-group">
                  <input type="text" name="name" class="form-control" placeholder="Nombre y Apellidos" required="required">
                </div>
              </div>
              <div class="col-sm-6">
                <div class="form-group">
                  <input type="email" name="email" class="form-control" placeholder="E-mail" required="required">
                </div>
              </div>
            </div>
            <div class="form-group">
              <input type="text" name="subject" class="form-control" placeholder="Asunto" required="required">
            </div>
            <div class="form-group">
              <textarea name="message" id="message" class="form-control" rows="4" placeholder="Escribe tu mensaje" required="required"></textarea>
            </div>                        
            <div class="form-group">
              <button type="submit" class="btn-submit">Enviar E-mail</button>
            </div>
          </form>

and

<?php
$name       = @trim(stripslashes($_POST['name'])); 
$from       = @trim(stripslashes($_POST['email'])); 
$subject    = @trim(stripslashes($_POST['subject'])); 
$message    = @trim(stripslashes($_POST['message'])); 
$to         = 'hola@farmaviten.com';//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);

die;
?>

I allready set up an email account in cPanel and another one in Workspace(both different from each other) but im not receiving any email.I also found in godaddy's forum some guys had the same problem and it got fixed by calling and telling them to turn on some "MX entries". Did the same and mine is still not working.

Any ideas why is not working? please im desperate

0 Answers0