estoy haciendo validaciones desde formulario pero simpre son primero las del fichero
Código PHP:
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "localhost"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]"; // GMAIL username
$mail->Password = "*******"; // GMAIL password
$mail->AddAddress(strtolower($_POST['correo']),strtolower($_POST['nombre']) );
$mail->SetFrom('[email protected]', 'negocio');
$mail->Subject=("negocio ".strtolower($_POST['assumpto']));
$mail->MsgHTML(strtolower($_POST['mensaje']));
$mail->Send();