请教indy ssl连接pop邮件服务器的问题 ( 积分: 200 )

  • 主题发起人 主题发起人 wutianlong
  • 开始时间 开始时间
W

wutianlong

Unregistered / Unconfirmed
GUEST, unregistred user!
各位老大:
请问INDY SSL连接需要SSL安全连接的邮件服务器怎么做,我用了INDY10和INDY9的IdSSLIOHandlerSocketOpenSSL但还是连接不上,没法收到邮件;
请各位高手不吝赐教!
分数不多了,奉上最后的200分!我可是倾家荡产啦,救救我吧,各位大侠.
 
各位老大:
请问INDY SSL连接需要SSL安全连接的邮件服务器怎么做,我用了INDY10和INDY9的IdSSLIOHandlerSocketOpenSSL但还是连接不上,没法收到邮件;
请各位高手不吝赐教!
分数不多了,奉上最后的200分!我可是倾家荡产啦,救救我吧,各位大侠.
 
要下载Indy主页上的SSL部分的dll文件才行。
http://indy.fulgan.com/SSL/
 
我已下载了DLL,但是还是不行呀,有没有谁做过的,给个例子,比如连接GOOGLE的gmail
 
是不是一定要得到客户端证书啊,那要怎样才能得到呢?
 
这是一段英文文章,就是讲如何用Indy+SSL连接Gmail的。你看看:
GMail is the free mail service of Google.
Recently, the GMail accounts can also be accessed by means of POP3 and SMTP protocols (that is to say, to use them through a mail client program like OutLook)
It has a peculiarity, the access to GMail through POP3 uses encriptación SSL and No-Standard ports.
This tip explains briefly how to connect with POP3 service of GMail through the Indy components.

You need to put in one form these components:




A TidPop3 (idPop31) (Indy Clients Tab)

A TidMessage (idMessage1) (Indy Misc Tab)

A TIdSSLIOHandlerSocket (IdSSLIOHandlerSocket1) (Indy I/O handlers Tab)

A TMemo (Memo1)

A TButton (Button1)



So that the SSL works, the Indy uses the OpenSSL library, that is GPL and that another people do, for that reason, you have to download it so that the TIdSSLIOHandlerSocket can use it.

I for this test, have downloaded it of: http://indy.fulgan.com/SSL/and the file that I have used is indy_openssl096.zip

Descompress the the ZIP and put the two DLLs in the directory of your project.

Now, make that idPop31 uses the IdSSLIOHandlerSocket1 putting it in its IOHandler property.

Set the name of the pop server in the Host property of idPop31, that in the case of Gmail is pop.gmail.com, set the port, that in this case is special and is 995 and set the username and your password in the idPop31 component.


Once made, to test the invention, put this code in the OnCLick de Button1:

procedure TForm1.Button1Click(Sender: TObject);
var
n,
nummsgs : integer;
begin
Memo1.Lines.Clear;
//Conectamos!
idpop31.Connect(0);

//Obtenemos el numero de emails que tenemos
NumMsgs:=idpop31.CheckMessages;

Memo1.lines.add( 'Emails:' +IntToStr(NumMsgs) );

for n:=1 to NumMsgs do begin
idpop31.RetrieveHeader(n,idMessage1);
Memo1.Lines.Add( 'Email Nº:'+IntToStr(n)+
' De:'+idMessage1.From.Text+
' Tema:'+idMessage1.Subject );
idMessage1.Clear;
end;
idpop31.Disconnect;
end;

and you will have an example that will obtain the headers of the emails of GMail account.

NOTE: Yo need an actual version of the Indy library. If your Delphi hasn't, dont worry, you can download it from the oficcial website: http://www.indyproject.org/
 
后退
顶部