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

Building an Email system in Delphi

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
  • 4
  • 2
  • 2
  • +2
4 Solutions
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 http://prdownloads.sourceforge.net/hotpop3/pop3httpproxy.0.0.1.zip?download
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.
These components might interest you

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.
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

myleseven1Author Commented:
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  :)
> 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 mail.yahoo.com.
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.  (www.rfc-editor.org, search for SMTP or POP3).  


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
ICS (http://www.overbyte.be/frame_index.html)

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.
"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..
myleseven1Author Commented:
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 mail.yahoo.com 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.


myleseven1Author Commented:
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 :)
myleseven1Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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