The Elearning Community • Email not getting sent using SMTP
Page 1 of 2

Email not getting sent using SMTP

Posted: Thu Jun 20, 2024 11:07 am
by zaff
Hi,
Formalms and the SMTP have been working well for some time now (many months), but it stopped working since 18th of June.
Our formalms are hosted in Linode and my SMTP server is with a local hosting provider.

When a user tries the "forgot password" link and puts in the email ID - Formalms keeps working in the background - I have to manually quit it.
I spoke to Linode, they say there are no restrictions on the email ports.

Now here is the interesting part - I tried using my friend's SMTP config (a different hosting provider) and also Gmail SMTP - when I tried the "forgot password" link, what it does is it rightfully finishes the process and tells me that email has been sent for resetting password, but email is not received (happens for both the smtp from my friend).

I spoke to the local service provider. he says there are no changes from his side.

My SMTP details are attached.
Not sure why
1. My SMTP that was working well all this while, suddenly stopped sending email
2. why is my friend smtp working - atleast the screen says the email has been sent (for lost password), but emails are not received.

Could you please help?

Re: Email not getting sent using SMTP

Posted: Thu Jun 20, 2024 11:47 am
by alfa24
Hi,
raise smtp_debug to 4 and post the debug log here.
P.S.: don't attach personal info such as user/passwords, even in a screenshot.

Re: Email not getting sent using SMTP

Posted: Thu Jun 20, 2024 2:21 pm
by mauro.renga
Hi, i have a similar problem.

I'm trying to setup SMTP (with Brevo or MailSender).

I followed the provider instructions but when i try to send e-mails from Forma nothing happen.

To alfa24: i tried to setup smtp_debug to 4 but error_log_php file doesn't show what we need.

Re: Email not getting sent using SMTP

Posted: Thu Jun 20, 2024 2:47 pm
by alfa24
When you set smtp_debug, PHPMailer won't fire errors, it will echo the info on the page.

Re: Email not getting sent using SMTP

Posted: Thu Jun 20, 2024 3:03 pm
by mauro.renga
Understood. No errors are shown on the page.

Re: Email not getting sent using SMTP

Posted: Thu Jun 20, 2024 3:10 pm
by alfa24
I did not mention "errors", but INFO.
You should see verbose mail log.
If you don't see them you should debug directly in the code.

Re: Email not getting sent using SMTP

Posted: Thu Jun 20, 2024 4:54 pm
by zaff
alfa24 wrote: Thu Jun 20, 2024 11:47 am Hi,
raise smtp_debug to 4 and post the debug log here.
P.S.: don't attach personal info such as user/passwords, even in a screenshot.

When I try the original smtp this is the message after raising smtp_debug to 4 [the smtp configuration was provided as a screenshot earlier -sorry about the password ..will change it once I fix this]

2024-06-20 15:27:45 Connection: opening to ssl://firstavocado.com:465, timeout=300, options=array()
2024-06-20 15:29:59 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://firstavocado.com:465 (Connection timed out) [/var/www/html/vendor/phpmailer/phpmailer/src/SMTP.php line 389]
2024-06-20 15:29:59 SMTP ERROR: Failed to connect to server: Connection timed out (110)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting

When I tried my friends smtp (i.e. brevo smtp) I got the following log. Do note, although I do not receive automated lost password emails, the message on the screen says "Thank you! We have sent you an email with the link to reset your password." (which was not the case with my actual smtp)

2024-06-20 15:40:47 Connection: opening to ssl://smtp-relay.brevo.com:587, timeout=300, options=array()
2024-06-20 15:40:47 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 [/var/www/html/vendor/phpmailer/phpmailer/src/SMTP.php line 389]
2024-06-20 15:40:47 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/var/www/html/vendor/phpmailer/phpmailer/src/SMTP.php line 389]
2024-06-20 15:40:47 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp-relay.brevo.com:587 (Unknown error) [/var/www/html/vendor/phpmailer/phpmailer/src/SMTP.php line 389]
2024-06-20 15:40:47 SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting


Pls help

Re: Email not getting sent using SMTP

Posted: Thu Jun 20, 2024 5:21 pm
by alfa24
Different issues, same cause: SSL connection. Is your instance secured?

Re: Email not getting sent using SMTP

Posted: Thu Jun 20, 2024 5:23 pm
by zaff
alfa24 wrote: Thu Jun 20, 2024 5:21 pm Different issues, same cause: SSL connection. Is your instance secured?
Not sure, what you mean by "secured".. you are speaking to a one less technical.

Re: Email not getting sent using SMTP

Posted: Thu Jun 20, 2024 5:27 pm
by zaff
mauro.renga wrote: Thu Jun 20, 2024 2:21 pm Hi, i have a similar problem.

I'm trying to setup SMTP (with Brevo or MailSender).

I followed the provider instructions but when i try to send e-mails from Forma nothing happen.

To alfa24: i tried to setup smtp_debug to 4 but error_log_php file doesn't show what we need.

Change ssl to tls ...it worked for me ... as brevo uses port 587

This site uses cookies.

Some of the cookies we use are essential for parts of the site to operate and have already been set. We also use Google Analytics scripts, which all use cookies.
You may delete or block all cookies from this site in your browser options.