{"action":"created","issue":{"url":"https://api.github.com/repos/PHPMailer/PHPMailer/issues/808","repository_url":"https://api.github.com/repos/PHPMailer/PHPMailer","labels_url":"https://api.github.com/repos/PHPMailer/PHPMailer/issues/808/labels{/name}","comments_url":"https://api.github.com/repos/PHPMailer/PHPMailer/issues/808/comments","events_url":"https://api.github.com/repos/PHPMailer/PHPMailer/issues/808/events","html_url":"https://github.com/PHPMailer/PHPMailer/issues/808","id":171910489,"number":808,"title":"PHPMailer SMTP ERROR","user":{"login":"SalientAnimal","id":20718818,"avatar_url":"https://avatars.githubusercontent.com/u/20718818?v=3","gravatar_id":"","url":"https://api.github.com/users/SalientAnimal","html_url":"https://github.com/SalientAnimal","followers_url":"https://api.github.com/users/SalientAnimal/followers","following_url":"https://api.github.com/users/SalientAnimal/following{/other_user}","gists_url":"https://api.github.com/users/SalientAnimal/gists{/gist_id}","starred_url":"https://api.github.com/users/SalientAnimal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SalientAnimal/subscriptions","organizations_url":"https://api.github.com/users/SalientAnimal/orgs","repos_url":"https://api.github.com/users/SalientAnimal/repos","events_url":"https://api.github.com/users/SalientAnimal/events{/privacy}","received_events_url":"https://api.github.com/users/SalientAnimal/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-18T14:10:07Z","updated_at":"2016-08-18T16:41:24Z","closed_at":"2016-08-18T15:46:30Z","body":"Hi All,\r\n\r\nI am running a Windows server, with Apache, php, and of coarse PHPMailer. I tested the configuration on my local machine and most of the configuration worked fine.\r\n\r\nWhen trying to implement PHPMailer on the Windows Server, the mail sending does not want to work. I get the following error message:\r\n\r\n> SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: No such host is known. (0) 2016-08-18 13:56:25\tSMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Message was not sent.Mailer error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting\r\n\r\nThe only difference between the two instances is the operating system. Could someone assist my in where I may be going wrong?\r\n\r\nHere is my code:\r\n\r\n```php\r\nrequire(\"../PHPMailerAutoload.php\"); // path to the PHPMailerAutoload.php file.\r\n\r\n$headers  = 'MIME-Version: 1.0' . \"\\r\\n\";\r\n$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\r\n    $body = \"<html>\\n\"; \r\n    $body .= \"<body style=\\\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#344433;\\\">\\n\"; \r\n    $body = $message; \r\n    $body .= \"</body>\\n\"; \r\n    $body .= \"</html>\\n\";\r\n\r\n// Additional headers\r\n\r\n$subject = 'Test Export' .\"\\r\\n\";\r\n\r\n// $headers .= 'Cc: birthdayarchive@example.com' . \"\\r\\n\";\r\n// $headers .= 'Bcc: birthdaycheck@example.com' . \"\\r\\n\";\r\n\r\n   $mail = new PHPMailer();\r\n   $mail->IsSMTP(true);\r\n   $mail->SMTPDebug = 1;   \r\n   $mail->Mailer = \"smtp\";\r\n   $mail->Host = \"smtp.sebenzela.co.za\";\r\n   $mail->Port = 587; \t\t\t\t\t\t// 8025, 587 and 25 can also be used. Use Port 465 for SSL.\r\n   $mail->SMTPAuth = true;\r\n   $mail->SMTPSecure = 'tls';   \r\n   $mail->Username = \"USERNAME\";\r\n   $mail->Password = \"PASSWORD\";\r\n   $mail->CharSet = \"UTF-8\";\r\n   $mail->SMTPOptions = array( \t\t\t\t// Bypass security verification on e-mail. WARNING: When using this method, \r\n    'ssl' => array(\r\n        'verify_peer' => false,\r\n        'verify_peer_name' => false,\r\n        'allow_self_signed' => true\r\n    )\r\n);\r\n  \r\n    \r\n   $mail->From     = 'FROMADDRESS@FROMDOMAIN.co.za';\r\n   $mail->FromName = 'FROM NAME';\r\n   $mail->AddAddress('TOADDRESS@TODOMAIN.co.za', 'Leon Claassen');\r\n   $mail->AddReplyTo('me@mymailserver.com', 'My Name');\r\n \r\n   $mail->Subject  = $subject;\r\n   $mail->Body     = $body.\"\\r\\n\";\r\n   $mail->WordWrap = 50;  \r\n \r\n   if(!$mail->Send()) {\r\n\t\techo 'Message was not sent.';\r\n\t\techo 'Mailer error: ' . $mail->ErrorInfo;\r\n\t\texit;\r\n   } else {\r\n\t\techo 'Message has been sent.';\r\n   }\r\n\r\n\r\n\r\n\r\n\r\nmysqli_close($con); \r\n\r\n\r\n?>\r\n```\r\n\r\nI am using the most recent versions of PHPMailer and PHP. \r\nHave I perhaps missed some configuration steps in the config files?\r\nI downloaded a fresh copy for both systems of PHPMAiler & PHP, I did not duplicate the config files."},"comment":{"url":"https://api.github.com/repos/PHPMailer/PHPMailer/issues/comments/240782744","html_url":"https://github.com/PHPMailer/PHPMailer/issues/808#issuecomment-240782744","issue_url":"https://api.github.com/repos/PHPMailer/PHPMailer/issues/808","id":240782744,"user":{"login":"Synchro","id":81561,"avatar_url":"https://avatars.githubusercontent.com/u/81561?v=3","gravatar_id":"","url":"https://api.github.com/users/Synchro","html_url":"https://github.com/Synchro","followers_url":"https://api.github.com/users/Synchro/followers","following_url":"https://api.github.com/users/Synchro/following{/other_user}","gists_url":"https://api.github.com/users/Synchro/gists{/gist_id}","starred_url":"https://api.github.com/users/Synchro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Synchro/subscriptions","organizations_url":"https://api.github.com/users/Synchro/orgs","repos_url":"https://api.github.com/users/Synchro/repos","events_url":"https://api.github.com/users/Synchro/events{/privacy}","received_events_url":"https://api.github.com/users/Synchro/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T16:41:24Z","updated_at":"2016-08-18T16:41:24Z","body":"It will be wherever the script is running, so on your web server. The problem is that the web server can't find the IP address of your mail server from the name you've given it (`smtp.sebenzela.co.za`), hence the error. Read the guide and do the tests that it suggests, which will tell you what's going wrong, but it can't tell you how to fix it."}}
{"actor":{"display_login":"Synchro"}}