Solved

scanning email inbox with nmpop3 in delphi 6

Posted on 2003-11-07
6
578 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 100 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
Independent Software Vendors: 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

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

Independent Software Vendors: 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!

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

724 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