Solved

scanning email inbox with nmpop3 in delphi 6

Posted on 2003-11-07
6
570 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
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

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.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
TVirtualStringTree  search using TEdit 7 81
Delphi XE10 Round Image 2 56
find a node in VST 2 47
Delphi...Split view - idea? 1 6
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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