я получаю две ошибки при попытке отправить почту:Проблемы с отправкой почты через PHPMailer
Warning: fsockopen() [function.fsockopen]: unable to connect to mail.localhost.com:25 (A
connection attempt failed because the connected party did not properly respond after
a period of time, or established connection failed because connected host has failed
to respond.) in C:\xampp\htdocs\euisample\class.smtp.php on line 122
SMTP -> ERROR: Failed to connect to server: A connection attempt failed because
the connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond.
(10060) Mailer
Error: SMTP Error: Could not connect to SMTP host.
На данный момент я просто использовать этот тестовый скрипт
require("class.phpmailer.php");
$mail = new PHPMailer();
$message = "Hello \n
Thank you for registering with us. Here are your login details...\n
User ID: $user_name
Email: $usr_email \n
Passwd: $data[pwd] \n";
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.localhost.com"; // SMTP server
$mail->SMTPDebug = 2;
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "mail.localhost.com"; // sets the SMTP server
$mail->Port = 25; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]"; // SMTP account username
$mail->Password = "xxx"; // SMTP account password
$mail->AddReplyTo("[email protected]", "First Last");
$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication";
$mail->MsgHTML($message);
$address = $usr_email;
$mail->AddAddress($address, "John Doe");
мне нужна система для отправки сообщений электронной почты. Если это невозможно с localhost, будет ли он работать с Gmail? Любые другие предложения?
Я сейчас получаю эти ошибки 'Warning: fsockopen() [function.fsockopen]: не удалось подключиться к ДУС: //smtp.gmail.com: 587 (Не удалось найти сокет транспорта "TLS" - вы забыли включить его при настройке PHP?) в C: \ xampp \ htdocs \ euisample \ class.smtp.php в строке 122 SMTP -> ОШИБКА: Не удалось подключиться к серверу: невозможно найти перенос сокетов " tls "- вы забыли включить его при настройке PHP? ' – user1296762
Вам нужно mod_ssl включить в XAMPP, чтобы использовать TLS. – brezanac
Как это сделать? В файле httpd-ssl? – user1296762