Obtendo as Configurações do Outlook Express
Como e se é possivel conseguir listar as configurações do Outlook Express pelo delphi?
Listar:
- As Contas
- Os POP3´s
- Os SMTP´s
- etc
Desde já,
Obrigado
Bruno Rodrigues
Listar:
- As Contas
- Os POP3´s
- Os SMTP´s
- etc
Desde já,
Obrigado
Bruno Rodrigues
Bfbraz
Curtidas 0
Respostas
Anfm
04/04/2005
Vc terá que ler essas informações do registro do windows.
O exemplo abaixo lê os servidores SMTP cadastrados no outlook. Testei apenas no 98, talvez no XP as chaves sejam diferentes.
with TRegistry.create do try
RootKey := HKEY_USERS;
if OpenKeyReadOnly(´.DEFAULT\Software\Microsoft\Internet Account Manager\Accounts\´) then
GetKeyNames(Chaves) ;
CloseKey ;
For I := 0 to Chaves.Count -1 do begin
if OpenKeyReadOnly(´.DEFAULT\Software\Microsoft\Internet Account Manager\Accounts\´+Chaves[I]) then
if ValueExists(´SMTP Server´) then begin
cbSMTP.Items.Add(ReadString(´SMTP Server´));
cbEmailRemetente.Items.Add(ReadString(´SMTP Email Address´));
end ;
CloseKey;
end ;
finally
Chaves.Free ;
Free
end ;
O exemplo abaixo lê os servidores SMTP cadastrados no outlook. Testei apenas no 98, talvez no XP as chaves sejam diferentes.
with TRegistry.create do try
RootKey := HKEY_USERS;
if OpenKeyReadOnly(´.DEFAULT\Software\Microsoft\Internet Account Manager\Accounts\´) then
GetKeyNames(Chaves) ;
CloseKey ;
For I := 0 to Chaves.Count -1 do begin
if OpenKeyReadOnly(´.DEFAULT\Software\Microsoft\Internet Account Manager\Accounts\´+Chaves[I]) then
if ValueExists(´SMTP Server´) then begin
cbSMTP.Items.Add(ReadString(´SMTP Server´));
cbEmailRemetente.Items.Add(ReadString(´SMTP Email Address´));
end ;
CloseKey;
end ;
finally
Chaves.Free ;
Free
end ;
GOSTEI 0