The code does not work(. It gives me the error
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
require_once 'vendor/autoload.php';
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
use Symfony\Component\Mailer\Transport;
use Symfony\Component\Mailer\Mailer;
use Symfony\Component\Mime\Email;
$transport = Transport::fromDsn('smtp://mymail@gmail.com:MYPASS@smtp.gmail.com:587');
$mailer = new Mailer($transport);
$email = (new Email());
$email->from('mymail@gmail.com');
$email->to('mymail@gmail.com');
$email->subject('Some subject');
$email->text('test-message');
$mailer->send($email);
?>
Tried to 'require' files with these classes, but it did not help. Also I checked my composer.json. There was Symfony, so I`m sure, I have it installed with my composer.