🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
6 messages
6 total messages Started by Jayme Jeffman Filho Fri, 09 Sep 2005 19:48
How to connect to a SMTP server using SSL.
#3510
Author: Jayme Jeffman Filho
Date: Fri, 09 Sep 2005 19:48
26 lines
1777 bytes
Hi,

I've installed Indy 9.0.18 on my C++Builder Professional edition IDE.

I've got some old information (2002 -  2004) on the Internet about
using the TIdSMTP to connect to the Gmail SMTP server which
requires SSL authentication.

I put the code bellow in the IdSMTP::OnConnected event hendler :
[code]
void __fastcall TForm1::SMTPConnected(TObject *Sender)
{
  SMTP->SendCmd("STARTTLS", 220); // jjf Applications hungs here
  SSLHandler->PassThrough = false;
  SMTP->Authenticate();
}
[/code]

If I comment the line {SMTP->SendCmd("STARTTLS", 220); } the application
execute the Authenticate method and there is no any Exception, otherwise the
application freezes !

Is the Indy 9 TIdSMTP component able to perform an SSL connection or not ?
Or it doesn't work with C++Builder and just with Delphi ?

Thanks a lot.
Re: How to connect to a SMTP server using SSL.
#3511
Author: Remy Lebeau (TeamB)
Date: Fri, 09 Sep 2005 21:49
24 lines
1858 bytes
"Jayme Jeffman Filho" <jaymenosp@jeffman.eng.br> wrote in message
news:4321e6dd@newsgroups.borland.com...

> I put the code bellow in the IdSMTP::OnConnected event hendler :

Do NOT send any SMTP commands in the OnConnected event hander.
TIdSMTP::Connect() performs various commands after connecting to the server,
namely processing the server's Greeting text and then requesting the
server's capabilities.  However, the OnConnected event is triggered before
that processing occurs.  If you send your own commands from inside the
OnConnected event, you will corrupt the conversation that TIdSMTP has with
the server.  You must wait until Connect() fully exits before doing
anything.

>   SMTP->SendCmd("STARTTLS", 220); // jjf Applications hungs here
>   SSLHandler->PassThrough = false;
>   SMTP->Authenticate();

I suggest you upgrade to Indy 10.  TIdSMTP in Indy 10 has native support for
the STARTTLS command.


Gambit
Re: How to connect to a SMTP server using SSL.
#3512
Author: Jayme Jeffman Filho
Date: Fri, 09 Sep 2005 22:39
38 lines
2214 bytes
Hi Remy,

As far as I know Indy 10 do not work with C++Builder6.0 , am I right ?

TIA

Jayme.

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> escreveu na mensagem
news:43220356$1@newsgroups.borland.com...
>
> "Jayme Jeffman Filho" <jaymenosp@jeffman.eng.br> wrote in message
> news:4321e6dd@newsgroups.borland.com...
>
> > I put the code bellow in the IdSMTP::OnConnected event hendler :
>
> Do NOT send any SMTP commands in the OnConnected event hander.
> TIdSMTP::Connect() performs various commands after connecting to the
server,
> namely processing the server's Greeting text and then requesting the
> server's capabilities.  However, the OnConnected event is triggered before
> that processing occurs.  If you send your own commands from inside the
> OnConnected event, you will corrupt the conversation that TIdSMTP has with
> the server.  You must wait until Connect() fully exits before doing
> anything.
>
> >   SMTP->SendCmd("STARTTLS", 220); // jjf Applications hungs here
> >   SSLHandler->PassThrough = false;
> >   SMTP->Authenticate();
>
> I suggest you upgrade to Indy 10.  TIdSMTP in Indy 10 has native support
for
> the STARTTLS command.
>
>
> Gambit
>
>
Re: How to connect to a SMTP server using SSL.
#3513
Author: Phony
Date: Sat, 10 Sep 2005 08:15
9 lines
1065 bytes
Jayme Jeffman Filho wrote:
> Hi Remy,
> 
> As far as I know Indy 10 do not work with C++Builder6.0 , am I right ?
> 
> TIA
> 

Correct.
Re: How to connect to a SMTP server using SSL.
#3518
Author: Jayme Jeffman Filho
Date: Tue, 13 Sep 2005 00:06
24 lines
1503 bytes
Can you help me to upgrade to Indy 10 on my C++Builder 6.0 Professional
edition enironment ?

TIA

Jayme.


"Remy Lebeau (TeamB)" <no.spam@no.spam.com> escreveu na mensagem
news:43220356$1@newsgroups.borland.com...
>
> "Jayme Jeffman Filho" <jaymenosp@jeffman.eng.br> wrote in message
> news:4321e6dd@newsgroups.borland.com...
>
> >   SMTP->SendCmd("STARTTLS", 220); // jjf Applications hungs here
> >   SSLHandler->PassThrough = false;
> >   SMTP->Authenticate();
>
> I suggest you upgrade to Indy 10.  TIdSMTP in Indy 10 has native support
for
> the STARTTLS command.
>
>
> Gambit
Re: How to connect to a SMTP server using SSL.
#3521
Author: Phony
Date: Tue, 13 Sep 2005 08:31
34 lines
1750 bytes
Jayme Jeffman Filho wrote:
> Can you help me to upgrade to Indy 10 on my C++Builder 6.0 Professional
> edition enironment ?
> 
> TIA
> 
> Jayme.
> 
> 
> "Remy Lebeau (TeamB)" <no.spam@no.spam.com> escreveu na mensagem
> news:43220356$1@newsgroups.borland.com...
> 
>>"Jayme Jeffman Filho" <jaymenosp@jeffman.eng.br> wrote in message
>>news:4321e6dd@newsgroups.borland.com...
>>
>>
>>>  SMTP->SendCmd("STARTTLS", 220); // jjf Applications hungs here
>>>  SSLHandler->PassThrough = false;
>>>  SMTP->Authenticate();
>>
>>I suggest you upgrade to Indy 10.  TIdSMTP in Indy 10 has native support
> 
> for
> 
>>the STARTTLS command.
>>
>>
>>Gambit
> 
> 
> 
> 
 From reading Remy's replies to other posters asking the same 
question...it can't be done as it is not currently supported.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads