# Email Config Error

**URL:** <https://discourse.cakephp.org/t/email-config-error/5020>\
**Category:** Need Help\
**Created:** [September 29, 2018, 10:04am UTC](https://discourse.cakephp.org/t/email-config-error/5020 "2018-09-29T10:04:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klaus](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/klaus/32/269_2.png) [@Klaus](https://discourse.cakephp.org/u/Klaus)\
**Post date:** [September 29, 2018, 10:04am UTC](https://discourse.cakephp.org/t/email-config-error/5020/1 "2018-09-29T10:04:54Z")

</div>

Hi, I have used my Email-Configuration since “years”. But now as I migrated to 3.6 I receive an error "Transport config “alfa” is invaled, the required `className`is missing.  
The error is thrown by Cake\Mailer\Email-\>\_contructTransport.

My configuration in the app.php is like:  
‘EmailTransport’ =\> [  
‘default’ =\> [  
‘className’ =\> ‘Mail’,  
// The following keys are used in SMTP transports  
‘host’ =\> ‘localhost’,  
‘port’ =\> 25,  
‘timeout’ =\> 30,  
‘username’ =\> ‘user’,  
‘password’ =\> ‘secret’,  
‘client’ =\> null,  
‘tls’ =\> null,  
],  
‘alfa’ =\> [  
‘default’ =\> [  
‘className’ =\> ‘Smtp’,  
// The following keys are used in SMTP transports  
‘host’ =\> ‘[alfa312.alfahosting-server.de](http://alfa312.alfahosting-server.de)’,  
‘port’ =\> 995,  
‘timeout’ =\> 30,  
‘username’ =\> ‘**’,  
‘password’ =\> '**\*’,  
‘client’ =\> null,  
‘tls’ =\> null,  
‘url’ =\> env(‘EMAIL\_TRANSPORT\_DEFAULT\_URL’, null),  
],  
],  
],

```
'Email' => [
    'default' => [
        'transport' => 'default',
        'from' => 'info@projekt-lebensalter.de',
    //'charset' => 'utf-8',
    //'headerCharset' => 'utf-8',
    ],
    'project' => [
        'transport' => 'alfa',
        'from' => ['info@projekt-lebensalter.de' => 'Projekt LebensAlter'],
    ],
],

```

The mail starts in the controller with:  
$this-\>getMailer(‘User’)-\>send(‘infomail’, [$user]);

The UserMailer.php:

\<?php namespace App\Mailer; use Cake\Mailer\Mailer; /\*\* \* User mailer. \*/ class UserMailer extends Mailer { /\*\* \* Mailer's name. \* \* @var string \*/ static public $name = 'User'; public function infomail($user) { $this-\>to($user-\>email) -\>profile('project') -\>emailFormat('html') -\>template('project\_info\_template') -\>layout('default') -\>viewVars(['name' =\> $user-\>username]) -\>subject(sprintf('Hallo, %s', $user-\>username)); } } I think the configuration in the newer cake-version needs changes, but which???

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [September 29, 2018, 11:37am UTC](https://discourse.cakephp.org/t/email-config-error/5020/2 "2018-09-29T11:37:52Z")

</div>

```php
‘alfa’ => [
  ‘default’ => [
    ‘className’ => ‘Smtp’,
    ...
  ]
]

```

that doesnt look ok, it should be without that `default` level here

---

<div class="post-metadata">

**Author:** ![Klaus](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/klaus/32/269_2.png) [@Klaus](https://discourse.cakephp.org/u/Klaus)\
**Post date:** [October 6, 2018, 12:00pm UTC](https://discourse.cakephp.org/t/email-config-error/5020/3 "2018-10-06T12:00:27Z")

</div>

Thanks, I wonder how I could oversee this.😬😀
