Contact form not send

Hello there

I just built my first contact form by following this guide: Guide Contact Form

Everything worked fine but I get an error when sending the form on my website (also tried it on my server): code 530 (indicates that the authentication failed)

This is my config file:

    'email' => [
        'transport' => [
            'type' => 'smtp',
            'host' => 'mail.cyon.ch',
            'port' => 465,
            'security' => true,
        ]
    ],

I followed the instructions here: config

Do I have to add the part with the authentication?

      'auth' => true,
      'username' => '...',
      'password' => '...',

And is it safe to store my password and username there or do I have to be more cautious? (I’m quite new to PHP, excuse me)

Yes, you need to authenticate. It doesn’t really matter where you store the username/password in this case, you have to store it somewhere. However, make sure not to commit content with critical data to a git repo, in such cases, uses an .env file that is excluded from Git is the preferred option.

For local testing, I recommend using MailPit or MailHog or a similar tool, see also Email testing | Kirby CMS

1 Like

Thank you, I added the authentication and everything works now :slight_smile: To my surprise, it even works now for local testing with Laravel Herd.