With the help of ChatGPT I ran this python script:
import smtplib
from email.message import EmailMessage
# Mailpit SMTP config
SMTP_SERVER = 'mail.servbay.host'
SMTP_PORT = 1025
SMTP_USERNAME = 'mailuser'
SMTP_PASSWORD = 'mailuserpassword'
# Email content
msg = EmailMessage()
msg['Subject'] = '✅ Test Email from Python (TLS)'
msg['From'] = 'sender@example.local'
msg['To'] = 'recipient@example.local'
msg.set_content('This email was sent using implicit TLS on port 1025 via Mailpit.')
try:
with smtplib.SMTP_SSL(SMTP_SERVER, SMTP_PORT) as server:
server.login(SMTP_USERNAME, SMTP_PASSWORD)
server.send_message(msg)
print('✅ Email sent successfully.')
except Exception as e:
print(f'❌ Failed to send email: {e}')
with this result:
✅ Email sent successfully.
Mailpit shows:
In Elements, my Form settings are:
When I click on the submit, nothing happens and nothing arrives at Mailpit.
I don’t get the Error or Success messages shown.
Not sure what to check out next. I have done all the ‘Mark Page as Changed’, closed and restarted Elements, republished and I can see the Form config.php file has been updated with the Form settings:
<?php
return [
'component_id' => 'rwBD2AFA9F_87A3_47F3_B31E_838CD83D42B3',
'spam' => [
'service' => 'none',
'recaptcha' => [
'secret_key' => '',
'site_key' => '',
],
'turnstile' => [
'secret_key' => '',
'site_key' => '',
],
],
'email' => [
'host' => 'mail.servbay.host',
'port' => '1025',
'smtp_secure' => 'tls',
'username' => 'mailuser',
'password' => 'mailuserpassword',
'subject' => 'Elements Contact Us',
'to_name' => 'Elements Webmaster',
'to_address' => 'info@servbay.host',
],
];
So unless there is something that leaps out as being wrong, I can wait until logging is introduced to help figure out why this isn’t working. 