Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 2 - Creating an Email Client with Borland Delp...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

Creating an Email Client with Borland Delphi
By: Jacques Noah
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 35
    2005-10-18

    Table of Contents:
  • Creating an Email Client with Borland Delphi
  • What you need
  • Coding
  • Improvements/Remarks

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating an Email Client with Borland Delphi - What you need


    (Page 2 of 4 )

    You need to have Indy 9 or 10 installed. If you have Delphi 6 and above, then you can skip this section; otherwise go to www.indyproject.org and download the version appropriate to your Delphi version. I am using Delphi 7 and Indy 10.0.52. There are proper guides on how to install Indy on your computer.

    I'm writing this tutorial on the assumption that you know how to use Delphi. If this is not the case then I would recommend you go to http://delphi.about.com for a beginner's course, before continuing.

    Lets' get started!

    Start up Delphi and create a new application - File | new | Application. For the purposes of this tutorial I will save the unit as mailer and the project as emailer. You can save it as anything you like. Drop a memo, five edit boxes, five static labels, a list box and two buttons on the form. Call button one "btBrowse" and button two "btMsg". Name the listview as lvAttachments and the five edit boxes as edTo, edFrom, edSubject, edCC, edBC. Call the five static labels From, To, CC, BC and subject. Also add a checkbox, an opendialog and another static label, and name it attachments. Go to the Indy Clients tab and get the idSMTP component, then go to the Indy Misc tab and get the idmessage component, and drop both of them onto the form.

    Indy Clients tab:

    Indy Misc tab:

    Now let me explain what these two components are and what use they are to our application.

    IdSMTP: This is basically a component that allows you to connect and communicate with the SMTP Server. To connect to an SMTP Server you need to have a hostname and password. These are usually available from your ISP, unless of course you installed your own SMTP server.

    IdMessage: This is a component that will take in all the headers of a message, such as who the message is from, who it is going to, the subject, body, CC and BCC. In other words, all the headers that you see on email messages. In addition, this component also handles the attachment(s) that you will send with your messages.

    To summarize:

    IdSMTP allows you to connect to the (SMTP) server with the host and password parameters and is also the component that actually sends the message. Without this component the message won't go anywhere. IdMessage component holds all the message headers, including any attachments. IdMessage literally needs to be filled with the message parts.

    At this point your application should look something like this:

    More Delphi-Kylix Articles
    More By Jacques Noah


       · Shh....Delphi makes it easy to create a mail client!! I want to learn how to use...
       · If i do create an MSAccess database to store email addresses in a Text field of the...
       · To use MS Access with Delphi, go to...
       · It's worth noting that Borland includes very capable POP3 and SMTP components....
       · Actually Delphi does not have a naive SMTP/POP3 server or client, it has been...
       · But someone could go out and spend 50 or 60 bucks on the Indy In Depth book, then...
       · I agree, upon discovering Indy components, the first thing i did was to buy a Indy...
     

    DELPHI-KYLIX ARTICLES

    - Loading an XML Document into the DOM
    - Delphi Wrapper Classes and XML
    - Delphi and the DOM
    - Delphi and XML
    - Internet Access: Client Service
    - Finishing the Client for an Internet Access ...
    - The Client for an Internet Access Control Ap...
    - User Management for an Internet Access Contr...
    - Important Procedures for an Internet Access ...
    - Server Code for an Internet Access Control A...
    - Constructing the Interface for an Internet A...
    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    Stay green...Green IT