php - PHPMailer, SMTP connect() failed error with Gmail ...
stackoverflow.com › questions › 25924651Sep 20, 2014 · 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');