telnet isn't just for ... telnet.
$ telnet smtp.example.co.uk 25
HELO me
MAIL FROM: [email protected]
RCPT TO: [email protected]
DATA
.. or you can use SWAKS! For some odd reason telnet is becoming rare as an installed binary.I used telnet(1) as a generic TCP text client for many years before switching to GNU/BSD netcat. Nowadays, netcat is more prominent then telnet, and telnet had its corner cases with control characters.
Never heard about https://jetmore.org/john/code/swaks/, thanks for the tip.
I discovered swaks recently, god I love that tool
You want nc (usually with -v) or socat. telnet is muscle memory for a lot of people (myself included sometimes) but it's a strictly inferior choice these days for poking arbitrary plaintext services.
The difference between "telnet" the program and "telnet" the protocol is especially important in this discussion, I think.
A more "proper" tool for that is netcat -- I doubt SMTP supports the Telnet option negotiations subsystem. (I also doubt SMTP servers can interpret the full suite of Network Virtual Terminal (NVT) commands that the Telnet protocol supports.) There's clearly enough similarity between the two protocols that if you're just using it to transfer plaintext it will probably work out fine, but they are distinct protocols.