How reliable is the method of sending messages to ICQ using PHP's mail() function?

The method of sending messages to ICQ using PHP's mail() function is not reliable because ICQ does not support email communication. To send messages to ICQ, you need to use the ICQ API or a third-party library that specifically supports ICQ messaging.

// Example code using a third-party library to send messages to ICQ
require 'vendor/autoload.php';

$icq = new ICQ('your_api_key');
$message = 'Hello from PHP!';
$icq->sendMessage('123456789', $message);