Я получаю две ошибки при попытке отправить почту:
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 = "xxx@localhost.com"; // SMTP account username
$mail->Password = "xxx"; // SMTP account password
$mail->AddReplyTo("xxx@localhost.com", "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?Любые другие предложения?