My forms just started giving me this error "SMTP Error: Could not connect to SMTP host. Failed to connect to server"
The testmail in Joomla is working fine, no problems. Debug is not reporting anny strange behaviors, I just get this message upon submitting!It is the same for my forms and the demo forms, anny Idés? Using Joomla 5.3.1 and no update between working and not!
Best regards
Gibban
Do you have SMTP enabled in the Joomla global config ? does the test mail get sent using the SMTP server ? you can check this after you receive the test mail in the message details.
if yes then please check that your ChronoForms email is using the same Test Email settings, the Recipient, the From name & Email
Yes the SMTP system in Joomla is working fine!And this is from the Submit tab.
Please remove the "From Settings" from your Email setup, and change the Recipients to some address @Gmail.com, does it work ?
The problem is found in the error log:
Error in Mail API: Connection: opening to localhost:25Connection failed. Error #2: stream_socket_client(): Unable to connect to localhost:25 (Connection refused)
Solution of this problem:
In server CLI:
sudo apt update
sudo apt install postfix
During install, choose:
"Satellite system"
Use your SMTP settings (smtp.mail.com:587)
This will make localhost:25 forward emails through your working SMTP.
sudo nano /etc/postfix/main.cf
Add these lines at the end:
relayhost = [smtp.mail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
Save and exit (Ctrl+X, Y, Enter)
Create password file:
sudo nano /etc/postfix/sasl_passwd
Add this line:
[smtp.mail.com]:587 mail@mail.com:YOUR_PASSWORD
Secure the file:
sudo postmap /etc/postfix/sasl_passwd
sudo chmod 600 /etc/postfix/sasl_passwd*
sudo systemctl restart postfix
Problem solved! Case closed!
I'm glad you solved it, thank you for posting the solution!
normally the SMTP should work fine using the PHP app (Joomla with phpmailer), no need to set SMTP configuration in postfix