PHPMailer, SMTP connect() failed error with Gmail I’m trying to make a contact form and I’m using PHPMailer. I tried that on localhost with xampp and it works perfect. But when i upload to my host i get the error SMTP connect() failed. Here is my code: $m = new PHPMailer; $m->isSMTP(); $m->SMTPAuth = true; $m->Host = "smtp.gmail.com"; $m->Username = "mymail@gmail.com"; $m->Password = "mypass"; $m->SMTPSecure = "ssl"; $m->Port = "465"; $m->isHTML(); $m->Subject = "Hello world"; $m->Body = "Some content"; $m->FromName = "Contact"; $m->addAddress('mymail@gmail.com', 'Test');
undefined
PHPMailer with GMail: SMTP Error I am making use of PHPMailer to send mail through GMail. The code I use is straight from a tutorial and it works perfectly on my laptop. However, testing this on a Windows 2003 Server - it seems to always return an SMPT error: SMTP Error: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host. Here is the settings I use in PHPMailer: include("phpmailer/class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth =