Click here to Skip to main content
15,901,035 members
Articles / Programming Languages / C#

.NET Mail Composer

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


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.


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


No updates so far.


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:

Visit my Site:

Comments and Discussions

GeneralVery simple e-mail client. Pin
vkrepets21-Dec-12 4:42
vkrepets21-Dec-12 4:42 
It works but message setup is very inconvenient.
GeneralFaliure sending mail. Pin
gs_virdi4-Aug-12 1:38
gs_virdi4-Aug-12 1:38 
QuestionWhat if the attach file is 5MB? I tried and it seems failed to send the mail. Pin
smilewei29-Aug-11 5:54
smilewei29-Aug-11 5:54 
AnswerRe: What if the attach file is 5MB? I tried and it seems failed to send the mail. Pin
SHRIDHAR TL15-Nov-11 6:13
SHRIDHAR TL15-Nov-11 6:13 
GeneralRe: What if the attach file is 5MB? I tried and it seems failed to send the mail. Pin
smilewei15-Nov-11 19:32
smilewei15-Nov-11 19:32 
QuestionWorks fine on VS2010 Pin
Wrangly9-Aug-11 21:17
Wrangly9-Aug-11 21:17 
QuestionGoto???? Pin
Ptitnorm22-May-09 5:19
Ptitnorm22-May-09 5:19 
GeneralDemo Link Pin
fwsouthern6-Aug-08 16:12
fwsouthern6-Aug-08 16:12 
GeneralDemo Link Pin
SHRIDHAR TL6-Aug-08 21:50
SHRIDHAR TL6-Aug-08 21:50 

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.