phpmailer send gmail smtp timeout [duplicate]

Here is a working example: require_once ( ‘class.phpmailer.php’ ); // Add the path as appropriate $Mail = new PHPMailer(); $Mail->IsSMTP(); // Use SMTP $Mail->Host = “smtp.gmail.com”; // Sets SMTP server $Mail->SMTPDebug = 2; // 2 to enable SMTP debug information $Mail->SMTPAuth = TRUE; // enable SMTP authentication $Mail->SMTPSecure = “tls”; //Secure conection $Mail->Port = 587; … Read more

How to send multiple attachment in single mail in php

Following the reusability principles, you can use https://github.com/PHPMailer/PHPMailer <?php require ‘PHPMailerAutoload.php’; $mail = new PHPMailer; $mail->isSMTP(); // Set mailer to use SMTP $mail->Host=”smtp1.example.com;smtp2.example.com”; // Specify main and backup server $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username=”jswan”; // SMTP username $mail->Password = ‘secret’; // SMTP password $mail->SMTPSecure=”tls”; // Enable encryption, ‘ssl’ also accepted $mail->From = … Read more