9951 explained code solutions for 126 technologies


php-swiftmailerHow to check Swiftmailer version?


To check the version of Swiftmailer, you can use the following code:

$swiftmailerVersion = \Swift_DependencyContainer::getInstance()->lookup('transport.version');
echo $swiftmailerVersion;

This will output the version of Swiftmailer, for example: 6.2.3.

The code consists of two parts:

  1. \Swift_DependencyContainer::getInstance()->lookup('transport.version') - This part looks up the version of the transport layer of Swiftmailer.
  2. echo $swiftmailerVersion - This part prints out the version of Swiftmailer.

Helpful links

Edit this code on GitHub