Simple Mail Transfer Protocol (SMTP) is a protocol for sending emails in an IP network. It can be used between an email client and an outgoing mail server or between two SMTP servers. SMTP is often combined with the IMAP or POP3 protocols, which can fetch emails and send emails. In principle, it is a client-server-based protocol. Commonly it's using TCP/25 port for unencrypted SMTP, TCP/465 for encrypted, TCP/587 for SMTP STARTLS Encryption.
SMTP Servers
SMTP servers play a crucial role in preventing spam by supporting ESMTP with SMTP-Auth for authorized user-based email sending. The Mail User Agent (MUA) converts emails into headers and bodies, uploading them to the SMTP server. A Mail Transfer Agent (MTA) checks email size and spam, storing it after validation. Occasionally, a Mail Submission Agent (MSA) or Relay server validates email origin to prevent Open Relay Attacks. The MTA then searches DNS for the recipient mail server's IP address.
swaks --from blackkitten@test.com --to whitekitten@test.com --header 'Subject: You have suspected of being kitten' --body 'Hi, our councel of spacemen chose by democratic voting that you are sus, so you have no other choice but to surrender and be ready for empty vastness of space. If you want to deny that, please join our chat here and explain your sus behaviour: https://test-chat-court.com' --server 13.13.13.13