{"action":"created","issue":{"url":"https://api.github.com/repos/PHPMailer/PHPMailer/issues/469","labels_url":"https://api.github.com/repos/PHPMailer/PHPMailer/issues/469/labels{/name}","comments_url":"https://api.github.com/repos/PHPMailer/PHPMailer/issues/469/comments","events_url":"https://api.github.com/repos/PHPMailer/PHPMailer/issues/469/events","html_url":"https://github.com/PHPMailer/PHPMailer/issues/469","id":98816900,"number":469,"title":"Message could not be sent.Mailer Error: SMTP connect() failed.","user":{"login":"rocky5469","id":13629932,"avatar_url":"https://avatars.githubusercontent.com/u/13629932?v=3","gravatar_id":"","url":"https://api.github.com/users/rocky5469","html_url":"https://github.com/rocky5469","followers_url":"https://api.github.com/users/rocky5469/followers","following_url":"https://api.github.com/users/rocky5469/following{/other_user}","gists_url":"https://api.github.com/users/rocky5469/gists{/gist_id}","starred_url":"https://api.github.com/users/rocky5469/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rocky5469/subscriptions","organizations_url":"https://api.github.com/users/rocky5469/orgs","repos_url":"https://api.github.com/users/rocky5469/repos","events_url":"https://api.github.com/users/rocky5469/events{/privacy}","received_events_url":"https://api.github.com/users/rocky5469/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-03T19:01:41Z","updated_at":"2015-08-04T02:03:04Z","closed_at":null,"body":"hi, i'm new to php and i have been trying to send e-mail through php, phpmailer is the only class i find most recommended by most of the developers. i tried almost all solutions for my error. i cant find the fix. I have tried the link below, but didn't get what to do, and googled for the solution, couldn't find any, which works for me.  tried almost all solutions, but it keeps showing me the same error.\r\n\r\nMessage could not be sent.Mailer Error:SMTP connect() failed.https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingAvailable\r\n\r\ntried the above link, as im new to php, im stuck.\r\n\r\nfr all smtpdebug: 1,2,3,4, its giving same error... but php mail() function is working fine.\r\n\r\nand our hosting provider says this...\r\n\r\nWe have the following list of ports open on our shared hosting plans:\r\n\r\nHTTP/HTTPS - 80/443\r\nGMail - 465/587/995/993\r\nTOMCAT - 8080\r\nSMTP/IMAP/POP - 25/143/110\r\n\r\nhere is the code im using. please help me to resolve the error. thanx in advance.\r\n\r\n```php\r\n<?php\r\n\r\n\r\nrequire 'phpmailer/PHPMailerAutoload.php';\r\n$mail = new PHPMailer;\r\n\r\n//$mail->SMTPDebug = 3;                               // Enable verbose debug output\r\n\r\n$mail->isSMTP();                                      // Set mailer to use SMTP\r\n$mail->Host = 'smtp.gmail.com';              // Specify main and backup SMTP servers\r\n$mail->SMTPAuth = true;                               // Enable SMTP authentication\r\n$mail->Username = 'userid@gmail.com';                 // SMTP username\r\n$mail->Password = 'secret';                           // SMTP password\r\n$mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted\r\n$mail->Port = 587;                                    // TCP port to connect to\r\n\r\n$mail->From = userid@gmail.com';\r\n$mail->FromName = 'Mailer';\r\n//$mail->addAddress('joe@example.net', 'Joe User');     // Add a recipient\r\n$mail->addAddress('name@mysite.com');               // Name is optional\r\n\r\n//$mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments\r\n//$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name\r\n$mail->isHTML(true);                                  // Set email format to HTML\r\n\r\n$mail->Subject = 'Here is the subject';\r\n$mail->Body    = 'This is the HTML message body <b>in bold!</b>';\r\n$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';\r\n\r\nif(!$mail->send()) {\r\n    echo 'Message could not be sent.';\r\n    echo 'Mailer Error: ' . $mail->ErrorInfo;\r\n} else {\r\n    echo 'Message has been sent';\r\n}\r\n?>\r\n```"},"comment":{"url":"https://api.github.com/repos/PHPMailer/PHPMailer/issues/comments/127455615","html_url":"https://github.com/PHPMailer/PHPMailer/issues/469#issuecomment-127455615","issue_url":"https://api.github.com/repos/PHPMailer/PHPMailer/issues/469","id":127455615,"user":{"login":"rocky5469","id":13629932,"avatar_url":"https://avatars.githubusercontent.com/u/13629932?v=3","gravatar_id":"","url":"https://api.github.com/users/rocky5469","html_url":"https://github.com/rocky5469","followers_url":"https://api.github.com/users/rocky5469/followers","following_url":"https://api.github.com/users/rocky5469/following{/other_user}","gists_url":"https://api.github.com/users/rocky5469/gists{/gist_id}","starred_url":"https://api.github.com/users/rocky5469/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rocky5469/subscriptions","organizations_url":"https://api.github.com/users/rocky5469/orgs","repos_url":"https://api.github.com/users/rocky5469/repos","events_url":"https://api.github.com/users/rocky5469/events{/privacy}","received_events_url":"https://api.github.com/users/rocky5469/received_events","type":"User","site_admin":false},"created_at":"2015-08-04T02:03:04Z","updated_at":"2015-08-04T02:03:04Z","body":"Synchro sorry, i didnt mentioned that the bold values in error message, keeps on changing each time i refresh my page..."}}