Solved

I need a code which fetches the new mails

Posted on 1998-10-26
3
149 Views
Last Modified: 2010-05-18
I would like to make a prog. which forwards the new mails automatically to an other prog. How can I fetch the new mails ???
0
Comment
Question by:kapitany
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
timberbt earned 100 total points
ID: 1621840
I assume you are logging into a POP3 mail server?  You first to attach via Telnet to port 110.  Then send "User <usernamehere>" <ENTER> "pass <passwordhere>" Enter then you use the list command to show you how many emails you have.  You parse through that and find the highest number (i.e. 9 or 15) then use the "retr <messagenumberhere>" command to view the messages and the "dele <messagenumberhere>" to delete them when you are done.  Retr will simply print them to the screen so you capture that and send it where you wish or modify it how you wish.
0
 

Author Comment

by:kapitany
ID: 1621841
Yep, it works fine. The problem is while I'm logged in the POP3 is kept locked so no other mail program can read form there. Outlook is checking this account every 1 minute. My problem is that I would like to have the email in two places. One is the forwarded place and one is the outlook. But if I keep locked the POP3 outlook can't download the email, and if I relese the lock I cant catch my mail. Do you have any idea how I can have both? It would be a possibility to forward the mail to two different place. One where outlook can download and an other where I can later forward, but how is it possible?? Any other idea is wellcomed !  Also a simple code would be nice to see how these POP3 login and checking works...
0
 
LVL 1

Expert Comment

by:timberbt
ID: 1621842
Well I guess that depends on the pop3 server...but you're going to hit problems running from the same account if your Outlook is deleting mail off the server than too.  That'd mean everytime it retrieves one, it deletes it.  So that wouldn't be any good anyways, you can try making a rule in outlook to forward everything to another account that you would use the other program for.  Otherwise, you're going to end up trying to cooridinate timing procedures between outlook and your program, and you'd have to have outlook keep messages on the server, and your program would be forced to make decisions as to whether it already had the mail that was out there.   It makes life a lot more difficult in other words.
But in outlook you can just tell it to forward "All mail directly to me" and forward that to some other account.  You'll have to use the rules wizard for that, it doesn't have a canned one, but it's real easy to do.  That way if you really wanted, you could also just filter stuff.  *BUT* this means that you getting mail to the other account is dependant on your outlook being up and running, which isn't neccesarily good.  You may want to check with whoever runs the POP server, I know some have the capability to forward copies of one message to others.  I know some used that as a form of a distribution list like a listserv.  You email to 1 address and multiple people get it.  
Probably not the answers you were looking for...but....:) Do what you gotta do eh?  
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Use email signature images to promote corporate certifications and industry awards.
Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

746 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