Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i try to write a custom smtp server with c#. Maybe there is something that i dont really understand about the whole mail stuff, thats why i am asking the question here.

Right now i am able to receive the data that a mailprogram (e.g. MS Outlook) sends to my smtp server (All the HELO stuff is working, hooray!!!!). Lets say that the recipient of the message is kermit@muppets.com. So i have the recipient of the message and i know that the recipient email adress is hosted on a server called muppets.com. But how do i transfer kermits mail to muppets.com? I don't need code but i would like to know about the concept, maybe a description on how the smtp server is communicating with the mail server, sending the mail to the mail server or whatever help is absolutely welcome.

Thanks in advance
Senol
Posted
Comments
CHill60 2-Jan-13 8:56am    
Overview explanation at http://computer.howstuffworks.com/e-mail-messaging/email3.htm but it may be a bit too high level to be of use.
Same with http://email.about.com/cs/standards/a/smtp.htm
but it might get you started.
I haven't posted this a solution in case someone else has better examples
SenolKnd 2-Jan-13 10:06am    
Thanks a lot. I knew about these links already. But like most other links that i stumbled across while searching for an answer, they exactly explain the communication between mail program and smtp server but make a mystery about what happens when the smtp server has to transmit the message to the recipients mailserver. But thank you anyway, any help is welcome, maybe somebody else finds helpful informations about this subject through these links and posts the results here as well.
CHill60 2-Jan-13 10:50am    
Did you find this article? http://www.samlogic.net/articles/smtp.htm
SenolKnd 3-Jan-13 3:26am    
No i didn't. Thank you. It explains it better than most of the infos i got when searching the net.

1 solution

The server is not "muppets.com". That is their domain name. You have to do a DNS look up to get the MX records for muppets.com and then use those MX records to get A record(s) for their mail server(s).
You can do this manually using nslookup (Easily done with code as well):
CSS
Default Server:  google-public-dns-a.google.com
Address:  8.8.8.8

> set type=mx
> muppets.com
Server:  google-public-dns-a.google.com
Address:  8.8.8.8

Non-authoritative answer:
muppets.com     MX preference = 10, mail exchanger = n7smtpin03f.starwave.com
muppets.com     MX preference = 10, mail exchanger = n7smtpin01f.starwave.com
muppets.com     MX preference = 10, mail exchanger = n7smtpin02f.starwave.com
> set type=a
> n7smtpin03f.starwave.com
Server:  google-public-dns-a.google.com
Address:  8.8.8.8

Non-authoritative answer:
Name:    n7smtpin03f.starwave.com.GeneralTool.com
Address:  205.173.226.25


Once you connect to a mail server, the SMTP commands are more or less the same as the client to server except that your server is now on the sending side.

PS: Emails from Beaker would be awesome! lol "Meep meep meep me-me-meep. Meep meep."
 
Share this answer
 
v2

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