I try google all morning, and I think I need Stackoverflow right now!
I wrote a simple script to send mail (from hotmail to gmail) but I get this error:
SMTP → ERROR: Could not connect to the server: the connection attempt failed because the connected party did not respond properly after some time or the connection was not established because the connected host could not respond. (10060) SMTP Connect () error. Mistake
This is the code:
<?php require_once("../includes/phpMailer/class.phpMailer.php"); require_once("../includes/phpMailer/class.smtp.php"); $to_name = "RECEIVER NAME"; $to = "RECEIVER@gmail.com"; $subject = "Mail test at " . strftime("%T", time()); $message = "This is a test message"; $message = wordwrap($message, 70); $from_name = "MY NAME"; $from = "MY_EMAIL@hotmail.it"; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPDebug = 2; $mail->Host = "smtp.live.com"; $mail->Port = 25; $mail->SMTPAuth = true; $mail->Username = "MY USERNAME (hotmail)"; $mail->Password = "MY PASSWORD (hotmail)"; $mail->FromName = $from_name; $mail->From = $from; $mail->AddAddress($to, $to_name); $mail->Subject = $subject; $mail->Body = $message; $result = $mail->Send(); echo $result ? 'Sent' : 'Error'; ?>
Other information is that the standard mail () function did not even work and did not check php info i:
sendmail_from - MY PROPER MAIL (hotmail)
sendmail_path - no value
SMTP - localhost
smtp_port - 25
Thank!
php phpmailer smtp
johnnyfittizio Jul 16 '13 at 9:35 on 2013-07-16 09:35
source share