C# Mail Client & Sending Mail With C# .NET
Programming April 17th, 2007As I mentioned below, the first small tutorial will be about writing a small mail client (smtp client). Before starting to tutorial, you have to design a simple GUI (graphical user interface) like below screen shot, a simple interface is enough. In this mail client we will use System.Net.Mail library to create mail and smtp client objects. Our code will be similar to below code piece,
MailMessage mymes = new MailMessage();
mymes.To.Add(new MailAddress(toTextBox.text);
mymes.From=new MailAddress(fromTextBox.text);
mymes.Subject=subjectTextBox.text;
mymes.Body=bodyTextBox.text;
SmtpClient myclient = new SmtpClient(“smtp server host address as string”);
myclient.Send(mymes);
It is easy as it is. It is extremely short and easy to understand (8 lines as you see), the complexity may emerge, if the smtp server needs authorization and maybe it need a ssl connection to authorize username & password (credentials). I leave those to ones who are interested in more than a simple stmp client, if you have any question or help please leave a comment.
An example GUI:

Some other posts that you may like :
Does EFX Bracelet really work ?Google Homepage Fade Effect
Other Browsers Play, Firefox 3 Kills !
Wireless Pen Mouse
Hard Disk Desk Clock
Sorting Algorithms
Dell Launches Ubuntu Computers
Gmail : New big attachment size !
How to run a proxy site ? Read This.
Some useful AES Documentation
Recent Comments