What could be causing delays of 120-180 seconds when sending emails via SMTP with AUTH LOGIN or AUTH PLAIN in PHP?

The delays of 120-180 seconds when sending emails via SMTP with AUTH LOGIN or AUTH PLAIN in PHP could be caused by the server's DNS resolution settings. To solve this issue, you can set the `smtp_host` configuration to an IP address instead of a hostname to bypass the DNS resolution delay.

// Set SMTP configuration with IP address instead of hostname
$mail->isSMTP();
$mail->Host = 'xxx.xxx.xxx.xxx'; // Replace with the IP address of your SMTP server
$mail->SMTPAuth = true;
$mail->Username = 'your_smtp_username';
$mail->Password = 'your_smtp_password';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;