• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 150
  • Last Modified:

E-Mail server

I want to develop E-Mail server using Dephi, how can I use Delphi's features of Client/server development, and is that easy in Delphi ?

Motaz
0
Motaz
Asked:
Motaz
  • 8
  • 4
  • 2
1 Solution
 
intheCommented:
what version of delphi you have?
do you have internet components?
if not get these:
http://www.pbe.com/Winshoes/
and f.piette's
http://www.rtfm.be/fpiette/indexuk.htm

with these it is fairly trivial to make.
if you have teh internet componeents then they have demos in the delphi\demos\internet directory.
Regards Barry
0
 
MotazAuthor Commented:
Delphi 4 Client/Server
0
 
MotazAuthor Commented:
did you mean smtp and pop componets ?, I do not want to use Windows post office, I want to write my own server and run it in Microsoft information server. Also I want to use internet explorer to open this mail, I mean the client must be Internte Explorer or Netscape Navigator

Thanks
Motaz
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
intheCommented:
have you looked at the demos.
im going to sleep now but later if this question still around i look back and see if i have examples of anything(i saved one once that someone posted a  but cant find it now)
what features do you want in your program?just fetch email from isp..
0
 
intheCommented:
oh i just see your next comment ,that seems more difficult certainly,and i dont have examples of this though the basic internals is probably the same i mean i suppose you still need to fetch email from isp ..(am i right ?)
0
 
MotazAuthor Commented:
did you mean that I muse use already exits mail servers ?
0
 
intheCommented:
er no..
0
 
MotazAuthor Commented:
did you mean that I muse use already exits mail servers ?
0
 
MotazAuthor Commented:
barry if you have yahoo messanger we can chat in it, my login name is motaz1
0
 
MotazAuthor Commented:
barry if you have yahoo messanger we can chat in it, my login name is motaz1
0
 
MotazAuthor Commented:
Adjusted points to 100
0
 
TheNeilCommented:
If you've got access to the Fastnet group of components then it's a totalt doddle (I can't remember which versions of Delphi that these ship with). To send mail use the NMSMTP component, and to receive mail use the NMPOP3 component.

To send mail add the following code:

BEGIN
  IF NOT(SMTP.Connected)
  THEN
  BEGIN
    SMTP.Host:= '192.130.0.1';
    SMTP.UserID := 'TheNeil';
    SMTP.Connect;
  END;

  IF SMTP.Connected
  THEN
  BEGIN
    SMTP.ClearParams := TRUE;
    SMTP.SubType := mtPlain;
    SMTP.EncodeType := uuMime;

    SMTP.PostMessage.FromAddress := 'TheNeil@geeza.com';
    SMTP.PostMessage.FromName := 'The Neil';
    SMTP.PostMessage.ToAddress.Text := 'bloke@geeza.com';
    SMTP.PostMessage.Body.Text := 'Message';

    SMTP.PostMessage.Subject := 'Subject';
    SMTP.PostMessage.Date := DateToStr(Date);

    SMTP.SendMail;
    MessageDlg('Mail sent', mtInformation, [mbOk], 0);
  END
  ELSE
    MessageDlg('NOT connected', mtInformation, [mbOk], 0);
END;

This example will send a simple message to the ToAddress address

To receive mail, use the following code:

BEGIN
  IF NOT(POP3.Connected)
  THEN
  BEGIN
    POP3.DeleteOnRead := FALSE;
    POP3.Host := '192.130.0.1;
    POP3.UserID := 'TheNeil';
    POP3.Password := 'Password'; {The Password MUST be supplied else we fail the authentication check straight away}

    Receive_MailClick(Self);
    POP3.Connect;
  END;
  IF POP3.Connected
  THEN
  BEGIN
    IF NOT(Timer1.Enabled)
    THEN
      MessageDlg(IntToStr(POP3.MailCount) + ' message(s)', mtInformation, [mbOk], 0);

    ListBox1.Items.Clear;
    FOR n := 1 TO POP3.MailCount
    DO
    BEGIN
      POP3.GetMailMessage(n);
      Mail := POP3.MailMessage;
      ListBox1.Items.Add(Mail.From + ' ' + Mail.Subject);
    END;
  END
  ELSE
    MessageDlg('NOT connected', mtInformation, [mbOk], 0);
END;

The above example will examine the mailbox specified, report how many messages there are and then list all of them in a listbox (well, it'll display the sender and subject)
0
 
MotazAuthor Commented:
TheNiel what about mail server ? did you mean that I must use windows post office ?

I use now Delphi 5 Enterprise

Motaz
0
 
TheNeilCommented:
Delphi 5 Enterprise definitely has the components that you need.
What do you mean by mail server? As long as you have an e-mail account setup on your machine, the POP3 and SMTP components can use it to send and receive mail for you.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 8
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now