Protocols like this are text based, so--for example--when you have a web client connect it sends some text to make a request for a URL and receives a text response which it must then read and interpret.
You want to find out to which port you need to connect to make a SMTP connection and then what text you need to send and receive in order to send your email.
--Phil.