[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

scanning email inbox with nmpop3 in delphi 6

Posted on 2003-11-07
6
Medium Priority
?
596 Views
Last Modified: 2010-04-16
hi there ,
i am having a problem in automating the pop3 email retrival i need to scan every 10 minutes an email inbox with nmpop3 and get the messages sent from someone and save the attachement file into a directory can anybody help me with this.
0
Comment
Question by:fadymoussallem
[X]
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
6 Comments
 
LVL 2

Expert Comment

by:Ray_Adams
ID: 9701086
What problem do you have?
0
 
LVL 17

Accepted Solution

by:
geobul earned 400 total points
ID: 9701664
Hi,

Something like :

procedure TForm1.Timer1Timer(Sender: TObject);
var
  i, j: integer;
  fname: string;
begin
  try
    with NMPOP31 do begin
      if not Connected then Connect;
      if MailCount > 0 then begin
        for i := 1 to MailCount do begin
          GetMailMessage(i);
          if MailMessage.Attachments.Count > 0 then begin
            for j := 0 to MailMessage.Attachments.Count - 1 do begin
               fname := ExtractFileName(MailMessage.Attachments[j]);
               CopyFile(PChar(MailMessage.Attachments[j]), PChar('c:\emails\'+ fname), false); // copy a file
            end;
          end;  
        end;
      end;
    end;
  except
    // error
  end;
end;

Regards, Geo
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9702490
Please, if you have Delphi6, DO NOT use NMPop3. The NetMasters components are notorious
for being buggy and haven;t been updated since 1998. They also do not include sourcecode.
Use Indy (included with D6)  or ICS Instead.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:fadymoussallem
ID: 9712784
thank you geobul for your help i am thankful but i am getting always a message fault saying "project raised exception class exception with message "- ERR message 1 has been deleted'
0
 
LVL 17

Expert Comment

by:geobul
ID: 9712980
Where are you getting that error? At what line? BTW, I forgot to call Disconnect at the end of the function.
0
 

Author Comment

by:fadymoussallem
ID: 9713336
thank you very much it worked but i called diconnect at the beginning of the function
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

650 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