The validator does not exist. Trying to test email with Valet and MailHog

Hello,

I am trying to do a quick test to see if MailHog is working with Kirby. However, I’m running into a problem.

The issue is this:

Exception thrown with message "The validator does not exist: email"

Stacktrace:
#15 Exception in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/src/Toolkit/V.php:244
#14 Kirby\Toolkit\V:__callStatic in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/src/Email/Email.php:237
#13 Kirby\Email\Email:resolveEmail in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/src/Email/Email.php:69
#12 Kirby\Email\Email:__construct in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/config/components.php:43
#11 Kirby\Cms\Core:{closure} in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/src/Cms/App.php:609
#10 Kirby\Cms\App:email in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/site/templates/home.php:65
#9 include in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/src/Filesystem/F.php:425
#8 Kirby\Filesystem\F:loadIsolated in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/src/Filesystem/F.php:364
#7 Kirby\Filesystem\F:Kirby\Filesystem\{closure} in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/src/Filesystem/F.php:372
#6 Kirby\Filesystem\F:load in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/src/Toolkit/Tpl.php:36
#5 Kirby\Toolkit\Tpl:load in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/src/Template/Template.php:163
#4 Kirby\Template\Template:render in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/src/Cms/Page.php:1017
#3 Kirby\Cms\Page:render in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/src/Cms/App.php:784
#2 Kirby\Cms\App:io in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/kirby/src/Cms/App.php:1191
#1 Kirby\Cms\App:render in /Users/gaufde/PhpstormProjects/kirby-sites/mvi_kirby/index.php:5
#0 require in /Users/gaufde/.composer/vendor/laravel/valet/server.php:110

site/config/config.php:

<?php

/**
 * The config file is optional. It accepts a return array with config options
 * Note: Never include more than one return statement, all options go within this single return array
 * In this example, we set debugging to true, so that errors are displayed onscreen.
 * This setting must be set to false in production.
 * All config options: https://getkirby.com/docs/reference/system/options
 */


return [
    'debug' => true,
    'email' => [
        'transport' => [
            'type' => 'smtp',
            'host' => 'localhost',
            'port' => 1025,
            'security' => false
        ]
    ],
];

site/templates/emails/email.php:

We are testing MailHog:

<?php echo $text ?>

site/templates/home.php:

<?php

$kirby->email([
    'template' => 'email',
    'from'     => 'yourcontactform@yourcompany.com',
    'to'       => 'you@yourcompany.com',
    'subject'  => 'Let us test if MailHog works',
    'data'     => [
        'text'   => 'Here is some dummy text',
    ]
]);

I have tested, and I can access the MailHog UI at http://127.0.0.1:8025/. I am using Laravel Valet in case that is relevant.

Thanks in advance!

I seem to have fixed the issue! However, I’m not entirely sure what I did.

Basically, I just moved on to setting up Xdebug and phpmon. The emails started working in the process of getting my .ini files sorted, the correct interpreter selected in PhpStorm, restarting valet, etc.

As long as it works now as it should…