Click here to Skip to main content
Licence 
First Posted 17 Feb 2003
Views 75,401
Downloads 3,032
Bookmarked 56 times

EmailSender

By | 17 Feb 2003 | Article
A suite of classes to send email messages and attachments.

EMailSender - a png file

Address Book - a png file

Introduction

EmailSender is a simple application which allows you to send an email with a text body or an HTML body and if you want one attachment file. The control which displays the email body is only a RichText control. This project is a mix of two initial projects:

  1. EmailSender C# project without an address book.
  2. AddressBook C# project.

Important note: You need the MagicLibrary to build the menus and the TabControl.

Description

This project uses some useful namespaces:

  • System.Windows.Forms and MagicLibrary classes to build the user interface (controls, context menus, notify icon, ...).
  • System.IO to read and write XML files.
  • System.Xml to parse XML files.
  • System.Web.Mail to create and send the email.

Also, EmailSender uses two XML files:

1. EMailConfig.xml to configure the email address and the smtpserver . You must edit and configure this file before start the application.

        
 <?xml version="1.0" encoding="utf-8" ?>
 <providers>
   <name>
     Provider name // examples: CompuServe, American Online ...,
     do nothing but it's a better description
     <smtpserver>smtpserver // examples: smtp.providerName.com,
     mail.providerName.com or the ip address</smtpserver>
     <email>your email address for this provider</email>
  </name>
     // You can add an another provider
  <name>
     <smtpserver></smtpserver>
     <email></email>
  </name>
 </providers>
        

When you connect to the net, choose the right email for the current provider (smtpserver will be right). If you change the provider, you must also change the email. With this, you don't need authenticate (no username and no password) to connect to the SMTP server.

2. AddressBook.xml with only two contacts but you can add or remove friends and contacts.

 <?xml version="1.0" encoding="utf-8" ?> 
 <book>
   <friend>
      <name>name friend</name>
      <email>email friend</email>
   </friend>
   <contact>
      <description>Submit an article to CodeProject</description>
      <email>submit@codeproject.com</email>
   </contact>
   <friend>
      <name>t</name>
      <email></email>
   </friend>
   <contact>
      <description>Contact the CodeProject webmaster</description>
      <email>webmaster@codeproject.com</email>
   </contact>
 </book>
        

Check the item in the ListView for select or remove.

Important note: the files EmailConfig.xml and AdressBook.xml must reside in the application directory (bin/debug, bin/release for examples).

That's all folks and good luck with C# programming .

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

pat29



France France

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionExample or add for control ... ? Pinmembermliss15:13 20 Nov '03  
AnswerRe: Example or add for control ... ? Pinmemberpat2918:01 20 Nov '03  
GeneralRe: Example or add for control ... ? Pinmembermliss18:20 20 Nov '03  
GeneralRe: Example or add for control ... ? Pinmemberpat299:44 21 Nov '03  
GeneralWrong URL for MagicLibrary PinmemberAxelM20:44 18 Feb '03  
GeneralRe: Wrong URL for MagicLibrary Pinmemberleppie6:34 19 Feb '03  
GeneralRe: Wrong URL for MagicLibrary PinmemberAxelM20:57 19 Feb '03  

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

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

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 18 Feb 2003
Article Copyright 2003 by pat29
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid