Page 1 of 1

Test mail could not be sent.

Posted: Fri Mar 08, 2024 6:51 pm
by Batdad
Hi,
Trying to send a test email out using the built in PHP mail function but it keeps failing.

Getting notice "Could not instantiate mail function." and error "Test mail could not be sent.".
I've looked around at the past posts on the subject and tried a few suggestions that I thought may of made sense such as disabling a couple of plugins and making sure custom reply was disabled, few other things I checked but as of yet no luck.
Using Joomla 3.10.12 and PHP 7.4.33. I know it's old but client doesn't really want to change the template if it's not necessary.

URL - https://www.umfci.ca

If someone could help that would be great

Re: Test mail could not be sent.

Posted: Fri Mar 08, 2024 7:38 pm
by Per Yngve Berg
The PHP Mailer is not configured properly on your server (php.ini)

Select SMTP instead and put in the Credentials for you host's SMTP Server.

Re: Test mail could not be sent.

Posted: Fri Mar 08, 2024 8:02 pm
by Batdad
Hi Per,

Thanks for the quick reply. Tried that and unfortunately I'm still getting errors:

Notice
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting

Error
Test mail could not be sent.

Pretty sure the settings are accurate.

Thoughts?

Cheers

Re: Test mail could not be sent.

Posted: Fri Mar 08, 2024 9:15 pm
by toivo
Debug the SMTP connection by following the instructions in this Joomla tutorial: How to debug SMTP mail in Joomla 3

Copy and paste the messages into your reply.

Re: Test mail could not be sent.

Posted: Tue Mar 12, 2024 2:31 pm
by Batdad
Thank you. Here's what I found

2024-03-12T14:21:39+00:00 ERROR 99.209.87.234 mail Error in Mail API: Connection: opening to ssl://smtp.ionos.com:587, timeout=300, options=array (
)
2024-03-12T14:21:39+00:00 ERROR 99.209.87.234 mail Error in Mail API: Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number [[ROOT]/libraries/vendor/phpmailer/phpmailer/class.smtp.php line 298]
2024-03-12T14:21:39+00:00 ERROR 99.209.87.234 mail Error in Mail API: Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [[ROOT]/libraries/vendor/phpmailer/phpmailer/class.smtp.php line 298]
2024-03-12T14:21:39+00:00 ERROR 99.209.87.234 mail Error in Mail API: Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.ionos.com:587 (Unknown error) [[ROOT]/libraries/vendor/phpmailer/phpmailer/class.smtp.php line 298]
2024-03-12T14:21:39+00:00 ERROR 99.209.87.234 mail Error in Mail API: SMTP ERROR: Failed to connect to server: (0)
2024-03-12T14:21:39+00:00 ERROR 99.209.87.234 mail Error in Mail API: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting
2024-03-12T14:21:39+00:00 ERROR 99.209.87.234 mail Error in Mail API: Connection: opening to ssl://smtp.ionos.com:587, timeout=300, options=array (
)
2024-03-12T14:21:39+00:00 ERROR 99.209.87.234 mail Error in Mail API: Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number [[ROOT]/libraries/vendor/phpmailer/phpmailer/class.smtp.php line 298]
2024-03-12T14:21:39+00:00 ERROR 99.209.87.234 mail Error in Mail API: Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [[ROOT]/libraries/vendor/phpmailer/phpmailer/class.smtp.php line 298]
2024-03-12T14:21:39+00:00 ERROR 99.209.87.234 mail Error in Mail API: Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.ionos.com:587 (Unknown error) [[ROOT]/libraries/vendor/phpmailer/phpmailer/class.smtp.php line 298]
2024-03-12T14:21:39+00:00 ERROR 99.209.87.234 mail Error in Mail API: SMTP ERROR: Failed to connect to server: (0)
2024-03-12T14:21:39+00:00 ERROR 99.209.87.234 mail Error in Mail API: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting

Re: Test mail could not be sent.

Posted: Tue Mar 12, 2024 3:18 pm
by Batdad
Found the issue, SSL/TLS needed to be changed to STARTTLS.

Thanks for all the help.

Cheers