Another Email Form issue

Hi everyone, sorry about this but I have been working to diagnose this for hours and have made no progress.

I have a basic form using the form component from Elements. The hosting platform is ionos.co.uk. I have the SMTP host, username and password set correctly - tested with the SMTP Tester Pro app.

The logs keep saying:
form_config.ERROR: EmailService: Exception in sendFormSubmission {“error”:“SMTP Error: Could not connect to SMTP host.”,“exception”:“[object] (PHPMailer\PHPMailer\Exception(code: 0): SMTP Error: Could not connect to SMTP host. at /homepages/17/d4299101015/htdocs/rw/elements/com.realmac.corepack/api/vendor/phpmailer/phpmailer/src/PHPMailer.php:2348)”

Any suggestions would be appreciated.

The fact it works in SMTP Tester Pro is a bit of a red herring, as that’s running on your Mac, not on the IONOS server.

That said, because it works in Tester Pro, it does confirm the form itself is set up correctly and behaving as expected :+1:

So far, so good.

Because it fails only when running on your server, this strongly points to a server-side configuration issue. Some shared hosts block outbound connections to mail ports 25 / 465 / 587 unless you use their own mail servers or enable specific settings. In some cases, those ports are blocked entirely by default.

The best next step is to contact IONOS support and explain that you’re trying to send email from a PHP-based form, then ask them for the exact SMTP details and requirements for outbound mail from your hosting package.

Let me know how you get on.

When you check the site with the console, do you see any errors listed?

And can you give us a look at the htaccess - at least for me I had to disable one command to get the form working for one client.

Thanks,
Jan

Hi Dan,

Thanks for the advice, I have raised a ticket with IONOS support as you suggested.

Regards

Roger

Hi Jan

I don’t seem to have a htaccess file on the server, I am using FileZilla Pro to upload via SFTP. I asked IONOS suppport about the lack of a default htaccess file in the same ticket I opened at Dan’s suggestion.

Regards

Roger

Hi @Lemmings72

Do you have the site published with the non-working contact form? If so, can you link us to the page, as well as send over your project file via Elements Cloud (redacting your email account password form the form settings beforehand) so we can take a look?

But yes wait for IONOS to get back to you with the correct SMTP details you should be using, also making sure they haven’t blocked any outgoing SMTP ports on your hosting account, just to make sure that’s all squared away before further testing.

Hi,

The site is located at https://cjbrowninteriors.co.uk/, the form is the ContactUs form, as oyu can see it is pretty basic.

IONOS have said that because it is a basic HTML site, it is the developers issue to solve and just confirmed that smtp traffic should be sent to the destination that I have used in the form. I will create a temporary copy of the project file with the password missing and send it over as you have suggested.

Thanks Roger

I have completed a new upload to Elements Cloud, the one dated today is the one without the password in it.

Thanks for having a look.

Hi Jan,

Thanks for the offer of taking a look.

I now have the following two files on the server, one is called “.htaccess-1” :

RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

and the other is called “.htaccess”

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Both files are in the root folder of the site.

Could you send the Elements Cloud link over? If you don’t want to post it on the forum you can send it to me via DM here.

Such a helpful web host. :smiling_face_with_tear:

IONOS are dreadful, always have been. The UK version of GoDaddy!

There are much better UK based web hosts out there.

1 Like

After they said that I complained that they closed the ticked and didn’t help do the work I asked for. They then sorted it out.

1 Like

Thank you to everyone for your help and suggestions, with your help, my form is now working as it should :slight_smile:

1 Like