Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to create smtp server in an easy for sending mail from desktop?
Thanks in Advance...
Posted
Comments
Sergey Alexandrovich Kryukov 13-Feb-15 2:56am    
You can, but why? How about using some existing SMTP server?
Are you sure you really want to create a server? If you need to send mail, this is not what you would need.
—SA

1 solution

If you look at SMTP protocol, you will see that this is the application-level protocol, right on top of transport-layer TCP:
http://en.wikipedia.org/wiki/Application_layer[^],
http://en.wikipedia.org/wiki/Transport_layer[^],
http://en.wikipedia.org/wiki/Transmission_Control_Protocol[^].

Therefore, keeping in mind that TCP is fully available from .NET FCL, you have to implement SMTP based on TCP. You don't have to use raw sockets, you can use more convenient TcpListener. Please see:
https://msdn.microsoft.com/en-us/library/system.net.sockets.tcplistener%28v=vs.110%29.aspx[^],
https://msdn.microsoft.com/en-us/library/system.net.sockets.socket(v=vs.110).aspx[^],
https://msdn.microsoft.com/en-us/library/System.Net.Sockets%28v=vs.110%29.aspx[^].

The protocol itself is completely described in the RFC standard IETF documents referenced here: http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol[^].

But… why? And where would you host your server? Why not using something already existing and operational?

—SA
 
Share this answer
 
Comments
Ghanshyam Vadher 16-Feb-15 0:57am    
I am working on project on winfomrs so I want that feature in my project for sending Email and SMS from that winform application.
So did you(@Sergey Alexandrovich) know some server for sending email from winform application??
Sergey Alexandrovich Kryukov 16-Feb-15 1:09am    
No, I don't use SMS, and use my own (more exactly, one from my Web service provider) mail server. However, many use Google mail server. As to SMS, you can do your own search and look for some SMS Gateway:
SMS gateway.
They are usually commercial, but I heard some provide their services free of charge, on certain condition.

Also please keep in mind that not we are not supposed to promote commercial service here. Just do your search. If you want paid service, always try before you buy.

—SA
Ghanshyam Vadher 2-Mar-15 5:30am    
Thanks Sergey Alexandrovich Kryukov
Sergey Alexandrovich Kryukov 2-Mar-15 8:18am    
You are very welcome.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900