Click here to Skip to main content
15,867,453 members
Articles / Programming Languages / C#
Article

.NET Mail Composer

Rate me:
Please Sign up or sign in to vote.
4.94/5 (39 votes)
6 Aug 2008CPOL2 min read 55.3K   5.2K   60   9
Compose mail messages and send them through your mail account provider.

Introduction

This is a simple application developed using C# to send mail (with attachments) to multiple users. It uses an SMTP server to send mails.

Using the demo

To use the demo application, open "MailComposer.exe" from the demo link above. Type the subject and the body of the message. If the body of the message needs to be in HTML format, then select the checkbox provided below the body.

Image 1

After typing in the normal message body and the subject, click Other --> Add Attachments. The form shown below will be displayed:

Image 2

In the above window, click on the Add button to browse and add a new attachment. Add all the files to be attached, and then click the OK button to save the attachments. When you click the OK button, the attachments window will be closed and the previous form will be visible. Finally, to send the mail, you require a mail provider and a valid account to connect and send the mail. So, click Other --> Settings to open the form below to provide the settings.

Image 3

  1. In the above form, select the provider in which you have the account. If your provider cannot be found in the list, then select Other from the list, and type the mail server name and the port used to connect to the server.
  2. Then, enter your user ID (complete mail address of the provider) and the password used to connect to the server.
  3. (Optional) Enter the display name which will be shown in the recipient's display.
  4. (Optional) Enter the Reply To address to which the recipient has to reply.
  5. Type the recipient's address at the Add Recipient space provided, and click the Add button to add the recipient to the list. Add more recipient mail addresses, if required.
  6. Finally, if the server requires secured connection, then select the Use Secured Connection checkbox.
  7. Click the Save button to save the settings temporarily till the new message is sent. The form will be closed and the previous form will be activated.

Finally, click on the Send button to send the mail message.

Clarifications

In case of any questions, or suggestions to improve the project, feel free to contact me at "shridhar_tl@ymail.com".

History

No updates so far.

License

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


Written By
Software Developer
India India


Completed B.Com(CS) at DGVC and GNIIT Software Engineering at NIIT. Resident at Chennai and working as a Software Engineer.



 Language / Technology :

C#, ADO.NET, ASP.NET, MVC, WCF, ASP, PHP, XML, Java, J2EE, HTML, JavaScript, JQuery, AngularJS, VB Script, C++, MS SQL Server, SSRS, MySql, Oracle, Oracle Forms Development, Windows, Linux.



Click here to view other articles.


Mail Me at:  shridhar_tl@ymail.com


Visit my Site:  www.iCodeIt.in


Comments and Discussions

 
QuestionGoto???? Pin
Ptitnorm22-May-09 5:19
Ptitnorm22-May-09 5:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.