Is there a way to get information from email using the Terminal and without external software?
It depends :-)

The Terminal.app itself doesn't know anything about Mail or the Internet, all (well, practically all, it can do some additional stuff but let's keep things simple) it can do is handle keyboard input and text output between the user and a so-called command shell (which on macOS usually is an application/binary called bash or nowadays zsh). So strictly speaking the answer is "no, Terminal.app is not able to access your mail".

If we widen the scope a bit and read the question as "Can I access my mail with bash/zsh and any Unix-type utility which is part of macOS and doesn't require additional installations" the answer is Yes. Using GNU Netcat to access your POP3 mail account shows how netcat (which is called nc on macOS) can be used to access mail stored on a POP server. I didn't find anything for accessing mail on an IMAP server but this should be possible as well.