Swiftmailer error

Hi guys, following Code throws out error message:

Swift_TransportException

Expected response code 220 but got code "", with message ""

Any ideas, how to fix this??

There’s my common/config/main-local.php




<?php

return [

    

    'components' => [

        'db' => [

            'class' => 'yii\db\Connection',

            'dsn' => 'mysql:host=localhost;dbname=yii2_widget',

            'username' => 'root',

            'password' => '',

            'charset' => 'utf8',

        ],

        

        'mailer' => [

            'class' => 'yii\swiftmailer\Mailer',

            'viewPath' => '@frontend/mail',

            'useFileTransport' => false,

            'transport' => [

            'class' => 'Swift_SmtpTransport',

            'host' => 'smtp.gmx.net',

            'username' => 'kipp.thomas@gmx.net',

            'password' => '123456',

            'port' => '465',

            'encryption' => 'tls',],],],]

        

?>




…and here’s my sending-script




<?php

//Code programmed by Thomas Kipp

//Change it, learn it, do as u please!

//path:views/site

use yii\helpers\Html;

use yii\widgets\ActiveForm;

use yii\web\session;

?>


<?php

$session = Yii::$app->session;

$session->open();

$session['iteration']=$model->iteration; 

$session['zahl_down']=$model->zahl_down; 

$session['zahl_up']=$model->zahl_up;

$session['email']=$model->email;

$session['username']=$model->username;


Yii::$app->mailer->compose()->setFrom('tklustig@web.de')

 	->setTo($model->email)

 	->setSubject('Message subject')

 	->setTextBody('Inhalt')

 	->send();

echo "Die Mail wurde an ".$model->email." verschickt.Bitte das Postfach überprüfen!";

?>

......

......

......