The same script with the same settings on Windows works, not on Linux.
<?php include 'PHPMailer/PHPMailerAutoload.php'; $mail = new PHPMailer; $mail->isSMTP(); $mail->Host = 'smtp.mail.ru'; $mail->SMTPAuth = true; $mail->Username = 'mailfrom@mailru'; $mail->Password = 'password'; //пароль $mail->SMTPSecure = 'ssl'; $mail->Port = 465; $mail->CharSet = 'UTF-8'; $mail->From = 'mailfrom@mailru'; // из какого эмейла $mail->FromName ='куда'; $mail->addAddress("mailto@mail.ru"); $mail->isHTML(true); $mail->Subject = "sssssssss"; $mail->Body = "gggggg"; $mail->AltBody = 'это альтернативное письмо'; $mail->SMTPDebug =3; if($mail->send()){ //echo 'письмо отправлено! Для окончания активации, зайдите на свой email и перейдите по ссылке в письме для окончания активации'; }else{ echo 'ошибка:' . $mail->ErrorInfo; } ?> phpmailer Version: 5.2.8
php version: 5.6.8
error that happens on linux
2015-07-23 09:26:51 Connection: opening 2015-07-23 09:26:52 SMTP ERROR: Failed to connect to server: (0) SMTP connect () failed. Error: SMTP connect () failed.
iptables-save. it will show the entire netfilter configuration (this is the linux program subsystem that handles the processing of network packets). - aleksandr barakinsmtp.mail.ru, at the same time it would be nice to check if other ports that are open on thesmtp.mail.ruserver aresmtp.mail.ru: 25, 587 or 2525. This can be done, for example, using thetelnetprogram:telnet сервер порт. if only one linetrying ip-адрес...type thetrying ip-адрес...and will “hang”, it means the connection does not occur. You can interrupt waiting withctrl+c. if the program displays several lines, and among them isconnected to сервер, the connection has occurred. in this case, you can interrupt like this:ctrl+], thenenterenter the wordquitandenteragain. - aleksandr barakin