This client code can be used to interact with simple SMTP servers. This code use TCP protocol using socket programming.server.
Python 2.7
Server from socket import * import threading import datetime
Client import os.path import re from socket import * import sys
Open commmand prompt/terminal and run:
E:\SMTP>python2 server.py
Server starting
Connection Establish
Open commmand prompt/terminal and run:
E:\SMTP>python2 client.py
220 Connection accepted from Eriquen-DESKTOP
250 Hello Eriquen-DESKTOP. Pleased to meet you.
From: eriquen@mail.com
250 OK
To: husni@mail.com
250 OK
354 Start mail input; end with <CRLF>.<CRLF>
Subject: Report Status
Message: Hi husni, what is our current report status?.
.
To end Message user need to send "." to the the server.
Open folder name "email".
Rename file format to .text.
Content of email.