PHP FORM ERROR

0

I ask you a question, when I click on send in my form, the page is reloaded and the email is not sent.

Here is the .php file

<?php
require 'PHPMailerAutoload.php';
require 'class.smtp.php';
require 'class.phpmailer.php';

$mail = new PHPMailer;
//Vars
$name=$_POST['name'];
$email=$_POST['email'];
$msg=$_POST['message'];

//$mail->SMTPDebug = 3;                               // Enable verbose debug output

$mail->isSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'smtp.correoseguro.co;smtp.like***a.com.ar';  // Specify main and backup SMTP servers
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = '********@li***a.com.ar';                 // SMTP username
$mail->Password = '*************';                           // SMTP password
$mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, 'ssl' also accepted
$mail->Port = 465;                                    // TCP port to connect to

$mail->setFrom('s***@**ke***a.com.ar', 'PERALTA RAMOS');
$mail->addAddress('s*******@***ed*a.com.ar');               // Name is optional
$mail->isHTML(true);                                  // Set email format to HTML

$mail->Subject = $msubject;
$mail->Body    = "Nombre: " . $name . "\r\n" . "Mail: " .  $email . "\r\n" . "Mensaje: " . $msg;

if(!$mail->send()) {
    echo 'No se pudo enviar el mail';
    echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
    echo 'El mail ha sido enviado exitosamente!';
}

//$exito = $mail->Send(); // Envía el correo.
//if($exito){
//echo "El correo fue enviado correctamente.";
//}else{
//echo "Hubo un inconveniente. Contacta a un administrador.";
//}
//?>

And here the html part

<!-- Contact -->
                            <article id="contact">
                                <h2 class="major">Contacto</h2>
                                <form method="post" action="PHPMailer/contacto.php">
                                    <div class="field half first">
                                        <label for="name">NOMBRE</label>
                                        <input type="text" name="name" id="name" />
                                    </div>
                                    <div class="field half">
                                        <label for="email">MAIL</label>
                                        <input type="text" name="email" id="email" />
                                    </div>
                                    <div class="field">
                                        <label for="message">MENSAJE</label>
                                        <textarea name="message" id="message" rows="4"></textarea>
                                    </div>
                                    <ul class="actions">
                                        <li><input type="submit" value="ENVIAR" class="special" /></li>
                                        <li><input type="reset" value="LIMPIAR" /></li>
                                    </ul>
                                </form>
                                <ul class="icons">
                                    <li><a href="https://www.facebook.com/salva.castro95" class="icon fa-facebook"><span class="label">Facebook</span></a></li>
                                    <li><a href="https://www.twitter.com/salva_castro95" class="icon fa-twitter"><span class="label">Twitter</span></a></li>
                                    <li><a href="https://www.instragram.com/salva_castro95" class="icon fa-instagram"><span class="label">Instagram</span></a></li>
                                </ul>
                            </article>
    
asked by Salva Castro 17.02.2018 в 00:22
source

0 answers