Building an Email system in Delphi

Posted on 2004-10-07
Last Modified: 2008-01-09
Hi there team,

My freinds and I want to build an email system using delphi. It would be something similar to Microsoft Office.
We are trying to get some info on how to do this effectivly. We have spoken to someone who also is building one at the moment but he is having some difficulty.
He said that while he can send and receive email via some email servers, he is having difficulty in sending and receiving emails from some major servers like yahoo and hotmail. He is trying to use the IMAP protocol to do it.
FOr our email system we definatly want to be able to send emails to people with yahoo or hotmail accounts!
It seems that building your own email system is quite difficult.

Has anyone who has done this before got any ideas so that we can get started. Is using the IMAP protocol the way to do this or should we try another way?

Why is it so difficult to send and receive to yahoo and hotmail?

Where is the best place to start so that we can develop or program along the correct track?

Any help appreciatted
Kind Regards
Question by:myleseven1
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +2
LVL 11

Accepted Solution

calinutz earned 135 total points
ID: 12253979
It is easy to send and receive emails using smtp (simple mail transfer protocol). So you can build an email system (similar to outlookExpress) using smtp components from indy or if you have delphi 6

It is harder ... even impossible in somecases if the server does not provide smtp access. I once tryed to send an email using yahoo but with no succes. As for hotmail I do not know if it works through smtp.

Try this:
download  HotPOP3 from
it works on any Windows.

After installing this proxy, setup Indy or NMSMTP to access SMTP on localhost or and set your username
and password.
LVL 11

Expert Comment

ID: 12254061
These components might interest you
LVL 12

Assisted Solution

Ivanov_G earned 135 total points
ID: 12254075
First of all, I recommend you to use Indy Components:
Download them from:
on the bottom of the page you can download demos also.

For receiving the mail use TidIMAP4. This is IMAP implementation. Sending emails can be done using TidSMTPServer, which will act as local email server. This way sending emails will depend only on your system.

Receiving /not Sending/ emails to yahoo is a problem, because Yahoo and Hotmail don't offer POP3 or IMAP for free. As remember few months ago I check yahoo - it was $15/year if you want POP3 access. So probably this is the problem.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 12254941
THanks guys,
I will need some time to work on this feedback,
Just a question for Ivanov_G
" As remember few months ago I check yahoo - it was $15/year if you want POP3 access."

Does this mean that if we paid $15/ year or whatever the cost was would make it possible to send emails through yahoo once it was configured?

Once we created the email system and we gave it to our freinds and family would each person need to pay for the yearly fee to be able to send an email through yahoo or would we only need to pay once?

THanks guys  :)
LVL 12

Expert Comment

ID: 12256406
> Does this mean that if we paid $15/ year or whatever the cost was would make it possible to send emails
> through yahoo once it was configured?

You send email through SMTP (Simple Mail Transfer Protocol) and receive it via POP3/IMAP, in your case IMAP. Your mail server should be locally - as I told you above using TidSMTPServer. Thus you will have the outgoing server locally on your machine, build in your email system.

These $15/year were for something like "Yahoo Plus". This was a offer for POP3 access to your mail, 2 GB space and stuff like that. If you have POP3 you can open your Yahoo mailbox from Outlook or some other program. If you don't - you have to use the web interface on

Assisted Solution

Tyrsis earned 95 total points
ID: 12256985
I'm not entirely certain if he is asking to be able to send / recv email USING a yahoo/hotmail account.  Sending and receiving email FROM a yahoo/hotmail account is easy, since all you do is login to your POP3 / IMAP server and just download the messages.  If you want to send and receive email USING a yahoo/hotmail account, then you would have to use a lot of trickery, most of which I believe hotmail/yahoo check for now anyway.  (pretending to be a web browser, logging in that way, and then parsing the web pages internally, which is basically a huge undertacking).  The components listed above by the various responders is a good place to start.  Also it wouldn't hurt to learn the SMTP / POP3 RFCs, since they are important in knowing how things work.  (, search for SMTP or POP3).  


Assisted Solution

RenegadeBBS earned 135 total points
ID: 12257344

If you mean using your application to send the email to yahoo not use yahoo to relay mail through them, but to a yahoo email account then you have to consider that alot of spam filters have been put in place and alot of smtp will reject a dynamic ip.  Thus, either get a static ip and go around to all the spam db's and submit your ip for being not a spam net.
I don't have the list in my head right now, but there are a spam lists that major email places use to filter out spam urls.

Now, about building one of these beast's.. I suggest indy.  Its a rather robust internet component suite that is freeware. With something like this you wouldn't have to learn how to do raw socket api calls and build your own units/objects.  I believe it even has a bare bones example of a smtp email server.  If you have a news client then support for it is really nice.

Another good component suite with a good user base to help with problems is

If you plan on doing this for personal pleasure and not really want to profit from it.  I suggest putting it upon sourceforge.  I don't think there is a delphi open source mso clone upon there.

Expert Comment

ID: 12257363
"He said that while he can send and receive email via some email servers, he is having difficulty in sending and receiving emails from some major servers like yahoo and hotmail."

I can see sending, but recieveing?  How does he have his helo and ehlo setup for the smtp.  Cause yahoo doesn't have a problem sending to spam urls.  Just recieveing.

Nice example of doing smtp with raw sockets..

Author Comment

ID: 12272425
Hi guys,
A freind of mine gave me these comments. I thought you might find them interesting...

"Anyway, the problem with trying to read email with
Yahoo or hotmail is that they like to make money.  1
form of money is advertising. so hence around 2000
they stoped free poppy accounts.

There is 1 solution to this, but it is potenally
The way to get around it, is to make a HTTP client.
This client opens a socket to and
downloads a cookie plus a web page.

What you need to do, is to read there javascript code
and upload in a http post / get request back to the

The tricky part is to find out if they change the
verible names periodity or do they remain static?

Basically as you have guess it, to access them, you
need to create an automatic html broswer, you dont
need to make a javascript praser as you can hard code
the javascripts into the program.  You just need to
get the cookies, and (get 'n prase) and post.

I meant to make a program like that about 1.5 years
ago, as i was lasy when typing my username / password
all the time.  But unforantly i was also too lasy to
write the program.  :P
Orginally, i plan to make a sinple javascript wrapper,
but  1 javascript line could disable my attack, so the
only approach to this in my view is a client broswer

....The main risk in that area of aproach, is that they
can change the website in many different ways to
disable it.



Author Comment

ID: 12335283
I hope you don't mind if we take a while to post replys up for this question there are a few issues we need to understand before we proceed...
Myles :)

Author Comment

ID: 12651395
Hi we still havn't finished the system yet but i think it may take a bit longer yet. I would like to close this question now as I don't want to leave you all waiting. Perhaps in the future I will post another similar question, by this stage I think we will have more of an understanding of what needs to be done.

Thank you all for your help

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question