$ telnet <servername_or_ip> <port>
(Default port : 25)
> EHLO <servername>
First encode username and password in B64:
$ perl -MMIME::Base64 -e 'print encode_base64("<username>");'
$ perl -MMIME::Base64 -e 'print encode_base64("password");'
Then inside the telnet
> AUTH LOGIN
the server returns:
> 334 VXNlcm5hbWU;
B64 encoded string asking for username
Paste the base64 encoded username:
> dXNlcm5hbWU=
Then the server returns:
> 334 UGFzc3dvcmQ6;
B64 encoded string asking for password
Paste the B64 encoded password:
> cGFzc3dvcmQ=
Now the server should return:
> 235 Authentication succeeded
> MAIL FROM:<[email protected]>
The server should return:
> 250 2.1.0 Ok
Warning : Even if the sender is wrong or not authorized the server always return Ok, because the checking is done with both sender and recipient
> RCPT TO:<[email protected]>
The server should return:
> 250 2.1.0 Ok
> DATA
the server returns:
> 354 End data with <CR><LF>.<CR><LF>
Enter actual mail content:
> From: [email protected]
> To: [email protected]
> Subject: Test message
> Reply-to: [email protected]
> This is a test message.
Then press enter, a dot then enter again:
> 250 2.6.0 Queued mail for delivery
Disconnect
> QUIT
the server returns :
> 221 <servername> ESMTP <serverbannner> closing connection