Network Programming in .NET: With C# and Visual Basic .NET

More emails are sent every day than postal mail. Why? Because email is cheap, informal, fast, and can be picked up at the receiver's convenience. Emails can be automatically generated and sent, making them ideal for automated status notification. One day, you may receive an email from your home sprinkler system saying simply, "Your house is on fire."
After reading this chapter you will be able to send and receive emails from your .NET applications. These features can be useful for customer support systems, collaborative personnel management, and many other types of applications.
This chapter begins by describing how emails can be constructed and sent, using either a socket-level approach, or by using in-built .NET classes. Immediately following that, is a description on how emails may be received, again, by either using a socket level approach, or a higher-level methodology, leveraging Microsoft Outlook.
Every email must have a destination email address. An email address takes the following form:
<<i class="emphasis">Username</i>>@<<i class="emphasis">domain name</i>>
The domain name in an email address generally does not include the "www" prefix, which is common for Web site addresses. Despite that, the domain name is globally recognized under the DNS system. The username is recognized only by the recipient mail server.
Emails are not immediately delivered to the recipient; instead, they are initially sent to your ISP's or company's mail server. From there, they are forwarded to the recipient's mail server or held for a period of time until the...