Solved

Building an Email system in Delphi

Posted on 2004-10-07
11
978 Views
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
Myles
0
Comment
Question by:myleseven1
  • 4
  • 2
  • 2
  • +2
11 Comments
 
LVL 11

Accepted Solution

by:
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 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 127.0.0.1 and set your username
and password.
0
 
LVL 11

Expert Comment

by:calinutz
ID: 12254061
These components might interest you

http://www.kobira.co.jp/sakura/d_net_mail.htm
0
 
LVL 12

Assisted Solution

by:Ivanov_G
Ivanov_G earned 135 total points
ID: 12254075
First of all, I recommend you to use Indy Components:
Download them from:
http://www.indyproject.org/download/Files/Indy9.html
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.
0
 

Author Comment

by:myleseven1
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  :)
Myles
0
 
LVL 12

Expert Comment

by:Ivanov_G
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 mail.yahoo.com.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 3

Assisted Solution

by:Tyrsis
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.  (www.rfc-editor.org, search for SMTP or POP3).  

Tyrsis
0
 
LVL 1

Assisted Solution

by:RenegadeBBS
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
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.
0
 
LVL 1

Expert Comment

by:RenegadeBBS
ID: 12257363
Quote
"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.

http://www.swissdelphicenter.ch/torry/showcode.php?id=2134

Nice example of doing smtp with raw sockets..
0
 

Author Comment

by:myleseven1
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
risky.
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
server.

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
program....

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

Myles

0
 

Author Comment

by:myleseven1
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 :)
0
 

Author Comment

by:myleseven1
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
Myles
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now