How to use Office 365 with modern authentication using Kirbys built-in email?

Hi, previously I have used Kirby’s built-in email with settings in config.php with Office 365 and smtp basic authentication. It has worked great.

An example:


return [
	'email' => [
		'presets' => [
			'contact' => [
				'from' => '',
		'transport' => [
			'type' => 'smtp',
			'port' => 587,
			'security' => 'tls',
			'host' => '',
			'auth' => true,
			'username' => '',
			'password' => '...',

But today I was informed that basic authentication for Office 365 will stop working on October 1 2022 (so already passed).

Does anyone here have experience setting up Kirby with Office 365 and MFA (modern authentication) for a simple contact form?

I don’t have personal experience with sending emails via Office 365. From what I read in the Microsoft Tech Community, it should be possible to generate an “app password” from your Office 365 account. This app password can then be used with SMTP like before.

1 Like

Did you find a solution for this? I’m also having issues sending a form via using Kirby Uniform.

Not directly. There was no time to explore it in the project. But luckily it was possible to set in office365 to allow less security on selected e-mails. Don’t know exactly how though, because it was handled by an external company. So I run as usual like the example code in the thread.

Hi @jamiehunter, I was wondering how you went with this?

I am having issues as well when sending a form via I have requested that the client verifies that “SMTP Authentication” is enabled in their Office 365 admin account. Hopefully that helps me solve the issue.

For anybody else facing issues with Office 365. It worked for me after client enabled “SMTP Authentication” in their Office 365 admin account and using 'security' => 'tls'.