Witam,
Na lokalnym serwerze mam zainstalowany XAMPP (PHP Version 7.2.9) oraz wrzuconego PHPmailer'a w wersji 5 oraz poniższy kod. Czy ktoś ma pomysł gdzie leży problem??
<?php
require 'PHPMailerAutoload.php';
function sentmail($temat, $tresc) {
$mail = new PHPMailer();
$mail->CharSet = "UTF-8";
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "172.19.192.21"; // SMTP server
$mail->SMTPAuth = false; // enable SMTP authentication
$mail->Port = 25; // set the SMTP port for the GMAIL server
$mail->SMTPDebug = 10;
$mail->SetFrom('quality@text.com', 'Quality');
$mail->AddReplyTo("jacek.quality@text.com", "Jacek Nowak");
$mail->Subject = $temat;
$mail->MsgHTML($tresc);
$mail->AddAddress('hubert.quality@text.com','Hubert Nowak');
if(!$mail->Send()) {
echo "<br><br>Mailer Error: " . $mail->ErrorInfo;
} else {
echo "<br><brMessage has been sent";
}
}
sentmail('tresc tresc tresc', 'temat');
?>
Treść błędu:
2018-09-24 17:41:39 Connection: opening to 172.19.192.21:25, timeout=300, options=array ( 'ssl' => array ( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ), )
2018-09-24 17:41:39 SMTP ERROR: Failed to connect to server: An attempt was made to access a socket in a way forbidden by its access permissions. (10013)
2018-09-24 17:41:39 SMTP connect() failed.
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Mailer Error: SMTP connect() failed.
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting