Error while sending email

Hello i m trying to send email , i m using this code:

$mail = \Yii::$app->mailer->compose();



//$mail=->setSubject(‘Email sent from Yii2-Swiftmailer’);


and also i configured :

‘mailer’ => [

‘class’ => ‘yii\swiftmailer\Mailer’,

‘transport’ => [

‘class’ => ‘Swift_SmtpTransport’,

‘host’ => ‘’, // e.g. or

‘username’ => ‘’,

‘password’ => ‘xxx’,

‘port’ => ‘110’, // Port 25 is a very common port too



But it is not working , it gets me this error :


Class Swift_Mime_HeaderEncoder_QpHeaderEncoder does not exist

How can i solve this error ?

Thanks in advance

Off topic: Those are valid credentials for your email :o

with respect to swiftmailer terms, Class Swift_Mime_HeaderEncoder_QpHeaderEncoder refers to


So you may check the namespace and path to swiftmailer directory is correctly configured.

Yes i checked the path , but now don’t give me an error, but when i checked emails there were no messages.

Fixed credentials leak :)

Port 110? That´s for POP3. SMTP Port should be 25 (unsecured) or 465 (secured by SSL).

Yii2 + Swiftmailer @[yii2]+swiftmailer