Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Server email SMTP
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 2-Jan-13 3:23am
Comments
CHill60 at 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 at 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 at 2-Jan-13 10:50am
   
Did you find this article? http://www.samlogic.net/articles/smtp.htm
SenolKnd at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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):
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."
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 295
1 Maciej Los 280
2 Afzaal Ahmad Zeeshan 224
3 BillWoodruff 205
4 Sergey Alexandrovich Kryukov 195
0 OriginalGriff 6,499
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,193
3 Manas Bhardwaj 4,657
4 Maciej Los 4,120


Advertise | Privacy | Mobile
Web01 | 2.8.1411019.1 | Last Updated 2 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100