Telnet to your smtp server like:
telnet smtp.mydomain.com 25
Syntax :
telnet {smtp_domain_name} {port_number}
And copy and paste the below:
helo mydomain.com
mail from:<test>
rcpt to:<to>
data
From:
test@mydomain.com
Subject: test mail from command line
this is test number 1
sent from linux box
.
Note : Do not forgot the "." at end which represents end of the message</to></test>