BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

synapse & imap

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Antonello Carlomagno
Guest





PostPosted: Wed Jan 21, 2004 1:57 pm    Post subject: synapse & imap Reply with quote



Hi,

Someone can help me to create a client imap with synapse? examples ?

thanks
antonello


Back to top
Ben Hochstrasser [FF]
Guest





PostPosted: Wed Jan 21, 2004 5:49 pm    Post subject: Re: synapse & imap Reply with quote



Antonello Carlomagno wrote:

Quote:
Someone can help me to create a client imap with synapse? examples ?

The example below will login, fill ListBox1 with the root folders (inbox,
trash, etc) and copy the headers of the message in the inbox into Memo1.
Should get you started...

procedure TForm1.Button1Click(Sender: TObject);
var
imap: TImapSend;
n: integer;
sl: TStringList;
begin
sl := TStringList.Create;
imap := TImapSend.Create;
imap.Username := 'userid';
imap.Password := 'password';
imap.TargetHost := 'imap.server.domain';
if imap.Login then
begin
Memo1.Clear;
// get the folder list into ListBox1
imap.List('', Listbox1.Items);
// select the Inbox
if imap.SelectFolder('inbox') then
begin
// loop through the items
for n := 1 to imap.SelectedCount do
begin
// get each message's header
if imap.FetchHeader(n, sl) then
begin
// and append them to a TMemo
Memo1.Lines.AddStrings(sl);
Memo1.Lines.Append('');
end;
end;
imap.CloseFolder;
end;
imap.Logout;
end;
imap.Free;
sl.Free;
end;

--
Ben

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.