use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require './PHPMailer/src/Exception.php';
require './PHPMailer/src/PHPMailer.php';
require './PHPMailer/src/SMTP.php';
$mail = new PHPMailer(true);
try {
    $mail->isSMTP();   //Send using SMTP
    $mail->Host       = 'smtp.gmail.com';    	 
    $mail->SMTPAuth   = true;                                    
    $mail->Username   = 'jghomim@gmail.com';            
    $mail->Password   = 'msfhwacqnjnjhpps';                      
    $mail->SMTPSecure = 'Auto';     	       			 
    $mail->Port       = 587;                                    
    //Recipients
    $mail->setFrom('jghomim@gmail.com', 'Ghomi');
    $mail->addAddress('jghomim@gmail.com', 'Ghomi User');  
    
    // Add Static Attachment
    $attachment = '/path/to/your/file.pdf';
    $mail->AddAttachment($attachment , 'ac.pdf');
    
      	 
    //Content
    $mail->isHTML(true);                                	 
    $mail->Subject = 'Here is the first mail';
    $mail->Body    = 'This is the HTML message body <b>in bold!</b>';
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
    $mail->send();
    echo 'Message has been sent';
} catch (Exception $e) {
    echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
?>
