Hi guys,
Sanjay respect to two factors, i test a wamp server without that two factor and it works. It was too simply puting smtp config and testing with the email Test plugin. But I don't understand why from my vps is not working.
Visvanath I answer to your doubts:
> I am trying to send a mail from moodle
How exactly? Do you mean forum posts not going out as e-mail? Or (Moodle) messages not sent as e-mail? Or something else?
>>>> I tried with the email test plugin from my moodle, because from the chat neither was working. Then I decided to use the plugin.
The problem is that I have a moodle server at sered, but i bought a VPs server with Centos7 and I installed moodle on my own. All was working except that point (at this moment).
> using SMTP server.
Moodle always needs a SMTP server to sent e-mails out.
>>>> I mean with an own SMTP server (smtp.example.online) or I also tried with smtp.google.com. Both with the ports.
> The problem is that i tried with all of it and it's impossible to get it. I tried:
You don't need "all of it" (what are they?) just one way is enough. Let's take the first one:
>>>>> I mean that I tried all configurations that i know.
- Google
Doesn't work.
- Own SMTP: The same but with the other SMTP. Doesn't work.
-I tried with the php sendermail default (without any data in outgoing mail): This works, but i want with my "own smtp", not with php sender. Works
When the email test doesn't work the log is:
"
2020-08-27 11:47:31 Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array()
2020-08-27 11:47:31 Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed [/home/xxxxxx/public_html/moodles/lib/phpmailer/src/SMTP.php line 324]
2020-08-27 11:47:31 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/home/xxxxxxx/public_html/moodles/lib/phpmailer/src/SMTP.php line 324]
2020-08-27 11:47:31 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error) [/home/xxxxxxx/public_html/moodles/lib/phpmailer/src/SMTP.php line 324]
2020-08-27 11:47:31 SMTP ERROR: Failed to connect to server: (0)
2020-08-27 11:47:31 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
"
I was looking for a solution on internet, and I can't get any one.
I have SSL with letsencrypt through whm configuration.
> - Custom SMTP, and not working.
What is custom SMTP? Do you mean running a "Sendmail" on your localhost? Could you describe in more details how you configured, how you tested sending mails and how "not working" looks like?
> Also I verify telnet through SSH, and it's gettin a response.
"telnet through SSH"? Why do you need telnet if you have SSH? Do you mean you run 'telnet localhost 25' in an SSH terminal?
>>>>> Yes, write in a SSh terminal the command "telnet mail.****.*** 25" and it connects.
Thx for your answers.