Conexão com gmail e outros

Aqui você poderá oferecer suas Contribuições, Dicas e Tutoriais (Texto ou Vídeo) que sejam de interesse de todos.

Moderador: Moderadores

Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Conexão com gmail e outros

Mensagem por JoséQuintas »

Passei por isto hoje, e achei interessante:
The issue is that you are trying to connect to Google through an encrypted session port. How I have been able to get this done is to use stunnel to provide that encrypted session support. I was going to post a link to message threads that discuss this very topic, but I am not finding them just yet. Essentially, you would need to tell Gmail to allow less secure applications to access your account (there is a setting for this), and then install the free tool called stunnel. With this done, you point to use your local connection instead of using smtp.gmail.com. The local connection would be 127.0.0.1, on a port number of your choosing. This port number must be in your stunnel.conf file to allow stunnel to listen on that port for your connection request.

My stunnel.conf has the following related to Gmail:

CAfile = cert.pem
cert = client.pem
client = yes
RNDfile = .rnd
fips = no
output = stunnel.log
sslVersion = TLSv2

[gmail smtp]
accept = 27
connect = smtp.gmail.com:587
protocol = smtp

With the above stunnel configuration, I would connect to 127.0.0.1:27, where the semicolon (:) separates the IP address from the port number. Stunnel is configured to listen to port 27, and when a connection request is received on that port, it will establish an encrypted session with Gmail, allowing to be none-the-wiser while sending your emails.
Se o programa não tem os recursos pra conectar diretamente, instala-se o stunnel como intermediário.
Você passa a usar uma conexão local, e o stunnel faz o serviço.

Só não vi se tem isso pra Windows.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Responder