Windows Command Line Mail
Sending email from windows command line can be done via telnet. Skip the windows 7 telnet part to get right into action.
Windows 7 Telnet
Windows 7 doesn’t have telnet installed by default. You can install it though with ease.
“Control Panel” -> “Programs and Features” -> “Turn Windows Features on or off”
Choose from the list “Telnet Client” and you are good to go.
Windows Command Line Mail
Press [Win]+R and type “cmd”.
When command line opens up you are ready to use telnet.
Open connection Syntax: telnet Hostname Port
Example: telnet mail.neti.ee 25
If the connection was made successfuly with the mail server then you should receive a 200 error code.
For example: 220 Elion mailsystem V.3
From there on you just have to mimic the SMTP (Simple Mail Transfer Protocol) to get your e-mail sent.
Protocol
S: 220 Elion mailsystem V.3
C: HELO mail.neti.ee
S: 250 NETI-Relayhost1.estpak.ee
C: MAIL FROM:<>
S: 250 Ok
C: RCPT TO:<>
S: 250 Ok
C: DATA
S: 354 End data with <CR><LF>.<CR><LF>
C: From: “Bob Example” <>
C: To: Alice Example <>
C: Date: Tue, 15 Jan 2010 00:25:43 -0500
C: Subject: Test message
C:
C: Hello Alice.
C: This is a test message with 5 header fields and 4 lines in the message body.
C: Your friend,
C: Bob
C: .
S: 250 2.0.0 Ok: queued as 965B7145
C: QUIT
S: 221 Bye
