SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: Name or service not known (0) 2017-11-15 13:11:07 SMTP connect() failed.
<?php
require 'PHPMailerAutoload.php';
//echo !extension_loaded('openssl')?"Not Available":"Available <br/>";
$email = $_POST['email'];
$number = $_POST['phone'];
$client = $_POST['client'];
$to = 'myemailid@gmail.com';
$subject = 'user registration';
$phone = "phone number:".$number;
$message = "client details:"."\n"."email:".$email."\n"."phone number:".$number."\n"."client:".$client;
$headers = "From:".$email;
$mail = new PHPMailer;
$mail->SMTPDebug = 0; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'hosting.secureserver.net'; // ssl://smtp.gmail.com // Specify main and backup SMTP servers
$mail->SMTPAuth = false; // Enable SMTP authentication
$mail->Username = ''; // SMTP username
$mail->Password = ''; // SMTP password
$mail->From = 'myemailid@gmail.com';
$mail->SMTPSecure = 'none'; //TLS // Enable TLS encryption, `ssl` also accepted
$mail->Port = 25; //587 // TCP port to connect to
$mail->setFrom($email);
$mail->addAddress($to);
$mail->Subject = $subject;
$mail->Body = $message;
if($mail->send()) {
header("Location: ../../thankyou.html");
}
else {
echo $mail->ErrorInfo;
//header("Location: ../../error.html");
}
?>
this is the error i am receiving, as i am new to this php any detailed explanation would be highly appreciated. thank you