What could be causing the "Invalid address: smtp.web.de" error when trying to connect to a Web.de SMTP server using PHPMailer?

The "Invalid address: smtp.web.de" error could be caused by an incorrect SMTP server address or configuration in PHPMailer. To solve this issue, double-check the SMTP server address and make sure it is correctly specified in the PHPMailer settings.

// Include PHPMailer library
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

// Instantiate PHPMailer
$mail = new PHPMailer();

// Set SMTP server address
$mail->Host = 'smtp.web.de';