Contact form + GoDaddy

Hi Team :v:!

I have a project in Kirby version 4.3. It is hosted on a shared server at GoDaddy. The project contains a basic contact form that I have used in other projects and it works correctly, but in this project it is causing me the following error:

:warning: SMTP Error: Could not connect to SMTP host. Failed to connect to server

I have been researching this and they say that it requires another type of configuration.

Which is why I made the change:

Path: site/config/config.php

//= πŸ“© GoDaddy
'email' => [
	'transport' => [
		'host'     => 'localhost',
		'auth' => false,
		'port'     => 25,
	]
],

Initially I had the following:

Path: site/config/config.php

//= πŸ“© Configure Email
'email' => [
	'transport' => [
		'type' => 'smtp',
		'host' => 'server.mx',
		'port' => 465,
		'security' => true,
		'auth' => true,
		'username' => 'mailer@server.mx',
		'password' => 'passwordsecret',
	]
],

None of the settings make the emails reach my Gmail accounts, nor do they reach the server’s email accounts. So I continued investigating and saw the following configuration:

Path: site/config/config.php

'email' => [
	'transport' => [
		//= GMAIL
		'type' => 'smtp',
		'host' => 'smtp.gmail.com',
		'auth' => true,
		'username' => 'mailer@server.mx',
		'password' => 'passwordsecret',
		'security' => true,
		'security' => 'tls',
		'port' => 587,
	]
],

I have also tried the following:

Access PHPMailer

Path: site/controllers/contact.php

'beforeSend' => function ($mailer) {
	$mailer->SMTPOptions = [
		'ssl' => [
			'verify_peer'       => false,
			'verify_peer_name'  => false,
			'allow_self_signed' => true
		]
	];

	return $mailer;
}

I await your response and help please.

Thank you very much.

Regards!

1 Like

Hi @texnixe !

Thank you very much for the reply and help.

I will check with my provider.

Regards!