@nitishrai I would start with a very small SMTP server without encryption. Have a small basic application listen on SMTP-Port, spawning Thread-workers for incoming connection. Workers implement the SMTP Protocoll. After successfully receiving the message let the same thread send the message to the MX-Record-Server via SMTP. Without reading into the protocolls itself you won't get very far. A Mailserver can become a complex system as soon as you implement authentication, encryption, POP*, IMAP, Mail Queuing, Graylisting, Blacklisting, ....
So just start with a simple non encrypted SMTP Server just receiving SMTP-Emails for your host.
PS: you can send me PM within this domain, just click my nick and select Chat