title: PHPMailer keeps loading page
body: <p>I have been trying to send mail using PHPMailer from my localhost(XAMPP) but the page keeps loading. After some time it shows</p>
  <blockquote>
  <p>Fatal error: Maximum execution time of 120 seconds exceeded in C:\xampp\htdocs\test\vendor\phpmailer\phpmailer\src\SMTP.php on line 1227</p>
  </blockquote>
  <pre><code>use PHPMailer\PHPMailer\SMTP;
  use PHPMailer\PHPMailer\Exception;
  
  //Load Composer's autoloader
  require 'vendor/autoload.php';
  
  //Create an instance; passing `true` enables exceptions
  $mail = new PHPMailer(true);
  
  try {
      //Server settings
      // $mail-&gt;SMTPDebug = SMTP::DEBUG_SERVER;                      //Enable verbose debug output
      $mail-&gt;SMTPDebug = 2;                      //Enable verbose debug output
      $mail-&gt;isSMTP();                                            //Send using SMTP
      $mail-&gt;Host       = 'smtp.gmail.com';                     //Set the SMTP server to send through
      $mail-&gt;SMTPAuth   = true;                                   //Enable SMTP authentication
      $mail-&gt;Username   = 'my_email';                     //SMTP username
      $mail-&gt;Password   = 'my_password';                               //SMTP password
      // $mail-&gt;SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;            //Enable implicit TLS encryption
      $mail-&gt;SMTPSecure = 'tls';            //Enable implicit TLS encryption
      $mail-&gt;Port       = 587;                                    //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
      // $mail-&gt;Port       = 465;                                    //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
  
      //Recipients
      $mail-&gt;setFrom('my_email', 'Elexis');
      $mail-&gt;addAddress('recipient email.com');     //Add a recipient
      // $mail-&gt;addAddress('ellen@example.com');               //Name is optional
      // $mail-&gt;addReplyTo('info@example.com', 'Information');
      // $mail-&gt;addCC('cc@example.com');
      // $mail-&gt;addBCC('bcc@example.com');
  
      //Attachments
      // $mail-&gt;addAttachment('/var/tmp/file.tar.gz');         //Add attachments
      // $mail-&gt;addAttachment('/tmp/image.jpg', 'new.jpg');    //Optional name
  
      //Content
      $body= '&lt;strong&gt;This is my first email with php mailer&lt;/strong&gt;';
      $mail-&gt;isHTML(true);                                  //Set email format to HTML
      $mail-&gt;Subject = 'This Is My First Email';
      $mail-&gt;Body    = $body;
      $mail-&gt;AltBody = strip_tags($body);
  
      $mail-&gt;send();
      echo 'Message has been sent';
  } catch (Exception $e) {
      echo &quot;Message could not be sent. Mailer Error: {$mail-&gt;ErrorInfo}&quot;;
  }
  
  </code></pre>
  <p>how do i solve this?</p>