I have a simple php contact form. It works perfectly in localhost, I uploaded to godaddy server and it simply does not work. I found many blogs about it but all of them are from 5 years ago. This is the code:
require("../../phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->Username = "mail@gmail.com";
$mail->Password = "password";
$mail->AddAddress("mail@gmail.com");
$mail->FromName = "Dolph"; // readable name
$mail->Subject = "Subject title";
$mail->Body = "Nombre: ". $_POST['nombre'] ."\r\n" . "Email: ". $_POST['email'] ."\r\n" .
"Telefono: ". $_POST['numero'] ."\r\n" . "Comentario: ". $_POST['comentario'] ."\r\n";
$mail->Host = "relay-hosting.secureserver.net"; // GMail
$mail->Port = 465;
$mail->IsSMTP(); // use SMTP
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->From = $mail->Username;
if(!$mail->Send())
echo "<div class='alert alert-danger' role='alert'>¡Su correo no se envió exitosamente!</div>";
else
echo "<div class='alert alert-success' role='alert'>¡Su correo se envió exitosamente!</div>";
}
Please help me with this issue. Thanks developers.