Error 501 b'5.5.4 Invalid domain name

I figured it out!
The error that i was facing is that the SMTP server was expecting an FQDN during the HELO/EHLO stage of the SMTP handshake, and my “DESKTOP-Name” (hostname) was not considered a valid FQDN.
So i changed it to a more generic name using this comand < sudo hostnamectl set-hostname localhost.localdomain >.