Visual C # is the next-generation program development language introduced by Microsoft. He not only has the powerful features of Visual C + +, but also has the simplicity of Visual Basic, easy to start features. So once launched, it received a large number of program developers welcome. One obvious difference between Visual C # and Visual C + + is that Visual C # itself is not a class library, and Visual C + + is itself with a class library. Visual C # Although there is no class library, but as. NET Framework, a very important development language. He can use it. NET Framework provides a common software development package--. NET Framework SDK. This software development package can be said to be an extension of Visual C # functionality that Visual C # uses to achieve many of the functions that it cannot achieve. This article is an introduction to how Visual C # uses this software development package to send e-mail.
A Environment settings for software development and operation:
I > Windows System 2000 Server Edition
II >.. Net FrameWork SDK Beta version 2
III >. Open Control Panel, go to add and Remove Programs, and then click Add/Remove Windows components to see the following interface:
Figure 01: System Configuration Interface
Click "Internet Information Services (IIS)" and then tap "Details" to get the following interface:
Figure 02: System Configuration Interface
Click the SMTP serverce option in the click, and then press the OK button. Then press the Next button, and after the system restarts, the SMTP service required to run this program will be installed.
Two How Visual C # sends e-mail:
In the. Net FrameWork SDK Beta 2, there is a namespace called System.Web.Mail, which encapsulates the methods, objects, and properties that send e-mail messages in this namespace. Visual C # is the e-mail message that is sent by calling methods, objects, and properties in this namespace. In this article, two objects are used to send e-mail: one is the MailMessage object, which encapsulates the various attributes of an e-mail message, that is, the sender, the addressee, the subject of the letter, the content of the letter, and the attachment of the letter. The other is the SmtpMail object, the object's biggest role is to have defined the properties of the MailMessage object to send out, and complete this function, you need to call the SmtpMail object's Send () method.