whitt Posted October 25, 2014 Share Posted October 25, 2014 Hi guys , my script works perfectly in Gmail however i now need it to work in Outlook , when the form is submitted i get this error. 2014-10-25 18:49:00 SMTP ERROR: Failed to connect to server: Connection timed out (110) 2014-10-25 18:49:00 SMTP connect() failed. Mailer Error: SMTP connect() failed. <?php require("../lib/phpmailer/PHPMailerAutoload.php"); if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['phone']) || empty($_POST['message']) || !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) { echo "No arguments Provided!"; return false; } $m = new PHPMailer(); $m->IsSMTP(); $m->SMTPAuth = true; $m->SMTPDebug = 2; $m->Host = "smtp.live.com"; $m->Username = "test@outlook.com"; $m->Password = "pass"; $m->SMTPSecure = 'tls'; $m->Port = 465; // ive also tried 587 $m->From = "test@outlook.com"; $m->FromName = "test@outlook.com"; $m->addReplyTo('test@outlook.com ','Reply Address'); $m->addAddress('test@outlook.com', 'Some Guy'); $name = $_POST['name']; $email_address = $_POST['email']; $phone = $_POST['phone']; $message = $_POST['message']; $m->Subject = $subject; $m->Body = "You have received a new message. <br><br>". " Here are the details:<br> Name: $name <br> Phone Number: $phone <br>". "Email: $email_address<br> Message <br> $message"; $m->AltBody = "You have received a new message. <br><br>". " Here are the details:<br> Name: $name <br> Phone Number: $phone <br>". "Email: $email_address<br> Message <br> $message"; if(!$m->Send()) { echo "Mailer Error: " . $m->ErrorInfo; } else { echo "Message sent!"; return true; } ?> Quote Link to comment Share on other sites More sharing options...
sKunKbad Posted October 25, 2014 Share Posted October 25, 2014 (edited) Your comment makes it appear that you are not sure if the port is correct. Perhaps the documentation for outlook would let you know. I'm seeing online that it is 587. Take a look at this: http://subinsb.com/send-mails-via-smtp-server-gmail-outlook-php Edited October 25, 2014 by sKunKbad Quote Link to comment Share on other sites More sharing options...
whitt Posted October 26, 2014 Author Share Posted October 26, 2014 Your comment makes it appear that you are not sure if the port is correct. Perhaps the documentation for outlook would let you know. I'm seeing online that it is 587. Take a look at this: http://subinsb.com/send-mails-via-smtp-server-gmail-outlook-php Already tried both ports , i get exactly the same error. Quote Link to comment Share on other sites More sharing options...
sKunKbad Posted October 28, 2014 Share Posted October 28, 2014 Is it possible that your server does not have a valid security certificate, like a self signed one? It's just a thought, but that could be the problem if outlook mail servers require that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.