Form Email smtp

Hi all, I’m trying to set a form through this recipe.

When I tried to submit the form, the web page just loaded and then after several seconds this message appeared:
“The form could not be sent: SMTP Error: Could not connect to SMTP host.”

Is it an issue with client email provider? Is there any permission or setting that I need to specify?
Here’s the code:

/config.php


return [
  'email' => [
    'transport' => [
      'type' => 'smtp',
      'host' => 'host',
      'port' => 465,
      'security' => true,
      'auth' => true,
      'username' => 'email',
      'password' => 'pwd',
    ]
  ],

And I am pretty sure to have set the controller.php correctly because everything works with my Gmail account.

I don’t remember having to use that.

I followed this recipe and it wirks fine.

Sure that the transport settings are correct? Which provider is that?

The provider is MDaemon, but I tried different as well as Aruba or Netsons and it seems that a security parameters blocked the sending message.
I’m just guessing as SSL credentials are correct…

Hi @texnixe, I found out that the hosting provider is blocking SMTP external server.

Is there any workaround that we could consider?

If the hoster provides smtp email, you can go through them.

Or if your SMTP provider has an API, you can send through the API, maybe.