Unexpected error when trying to send a email via spring boot
I needed to write a service for sending emails, but no matter how many sources I looked at java mailer documentation, nothing comes out and crashes with an unexpected error: "Mail server connection failed. Failed messages: org.eclipse.angus.mail.util .MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 587; timeout -1;n nested exception is:ntjava.net.ConnectException: Connection timed out: connect".
Please tell me, maybe I overlooked something somewhere.
Here is my service, which is embedded in another through DI using the interface, there can be no errors there:
`@Service
public class EmailService implements IEmailService{