What are the differences between Zend Framework 1 and Zend Framework 2 in terms of accessing Zend_Mail?

In Zend Framework 1, accessing Zend_Mail involves creating an instance of Zend_Mail and setting the necessary parameters directly. In Zend Framework 2, accessing Zend_Mail requires using the Zend\Mail\Message class to create the email message and then passing it to the Zend\Mail\Transport\Sendmail or Zend\Mail\Transport\Smtp class for sending.

// Zend Framework 1
$mail = new Zend_Mail();
$mail->setBodyText('This is the text of the mail.');
$mail->setFrom('sender@example.com', 'Sender Name');
$mail->addTo('recipient@example.com', 'Recipient Name');
$mail->setSubject('Test Subject');
$mail->send();

// Zend Framework 2
$message = new Zend\Mail\Message();
$message->setBody('This is the text of the mail.');
$message->setFrom('sender@example.com', 'Sender Name');
$message->addTo('recipient@example.com', 'Recipient Name');
$message->setSubject('Test Subject');

$transport = new Zend\Mail\Transport\Sendmail();
$transport->send($message);