User Registration after code verification

I have been trying to set up a page where users can register after authentication using an emailed code.
I have been following the instructions in
https://getkirby.com/docs/cookbook/forms/user-registration

I can’t get the emailed code to arrive in an inbox, and despite this the user is listed in the panel.

Can anyone advise where I am going wrong?

This is my config.php code…

return [
	'debug' => true,
  'panel' =>[
    'install' => true
  ],

  // other settings
  'email' => [
    // see https://getkirby.com/docs/guide/emails#transport-configuration
    'transport' => [
      'type' => 'smtp',
      'host' => 'smtp.mywebsite.co.uk',
      'port' => 465,
      'security' => true
    ]
  ],
  // see https://getkirby.com/docs/reference/system/options/auth#login-methods
  'auth' => [
    'methods' => ['password', 'code']
  ],
];

Is that a valid SMTP host? Are you trying this locally or on a server?

I am trying on a server and the host value I am using is smtp.swswardrobes.co.uk

But does your server have/support SMTP?

Yes, it does

First thing I’d try: Try sending an email independent of user registration with those settings using $kirby->email(). Does this work?

If not, then those settings are probably not correct.

If it does work, then there’s probably something wrong in the rest of your code.

In that case, I’d install MailHog locally and debug where it’s going wrong.

I finally got there by adding username and password to the config settings.
Thanks everyone for pointing me in the right direction.