Hi,
after googling around and having seen a lot of messages to that issue I'm lost. Not one solution was applicable.
Sending an email from my Yii2 app results in
[Swift_TransportException] exception 'Swift_TransportException' with message 'Connection could not be established with host w010699b.kasserver.com [Unable to find the socket transport "TLS" - did you forget to enable it when you configured PHP? #0].
Same happens on my local host and on my webspace. On both TLS is enabled by the server and by PHP (says phpinfo()).
This is my config for SwiftMailer:
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => 'app\mail',
//'useFileTransport' => false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'host address',
'username' => 'myemail@mydomain.de',
'password' => '*********',
'port' => '587',
'encryption' => 'TLS',
'plugins' => [
[
'class' => 'Swift_Plugins_ThrottlerPlugin',
'constructArgs' => [20],
],
],
],
'messageConfig' => [
'charset' => 'UTF-8',
//'from' => ['' => 'myemail@mydomain.de',],
],
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
//'useFileTransport' => true,
],
Sending emails from other applications on the webspace is possible, the config values are valid and TLS is supported by my hoster.
I tried as encrypton STARTTLS, SSL, tls and none with port 25 all with the same result. Deleting plugins or messageConfig does not help anyway,
Find the model and the view attached.
Here is the action code (SiteController):
public function actionEmaillink() {
$getInput = Basics::TestInput();
$model = new EmaillinkForm();
if ($model->load(Yii::$app->request->post()) && $model->emaillink(Yii::$app->params['adminEmail'])) {
Yii::$app->session->setFlash('emaillinkFormSubmitted');
return $this->refresh();
}
return $this->render('emaillink', [
'model' => $model,
'id' => $getInput['id'],
'entryId' => $getInput['entryId'],
'year' => $getInput['year'],
]);
}
Hi, after googling around and having seen a lot of messages to that issue I'm lost. Not one solution was applicable. Sending an email from my Yii2 app results in
Same happens on my local host and on my webspace. On both TLS is enabled by the server and by PHP (says phpinfo()). This is my config for SwiftMailer:
Sending emails from other applications on the webspace is possible, the config values are valid and TLS is supported by my hoster. I tried as encrypton STARTTLS, SSL, tls and none with port 25 all with the same result. Deleting plugins or messageConfig does not help anyway, Find the model and the view attached. Here is the action code (SiteController):
So what to do? Regards Christian
emaillink.php.txt EmaillinkForm.php.txt