Inbound and outbound email with SSL

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Inbound and outbound email with SSL

Post by danielmaximiliano »

Hola a todos :
ultimamente mucha gente sigue teniendo problemas con los servidores POP con soporte SSL.

para que el ejemplo funcione es necesario tener instalado OpenSSL se puede descargar desde aqui.
Win32 OpenSSL v1.0.1e Light : Version simple
Win32 OpenSSL v1.0.1e : Version completa para desarrolladores
recordar que para el caso de Gmail es necesario entrar al panel de control de la cuenta y habilitar POP
buscar "Habilitar Pop Gmail" mediante Google.com para mas precisión
Todavia contiene algunos errores que son solucionables.
1) al adjuntar archivos mediante

Code: Select all

/*****************************************************************************/ 
Procedure SelectaFile()
/*****************************************************************************/
   aAFileSend := Getfile ( { {'All Files','*.*'} } , 'Select File(s) Attachment' ;
	                                  , cCurrentFolder +'\Attachment' , .t. , .f. )
Return
Figura :
_2013-02-13_20-47-16.jpg
_2013-02-13_20-47-16.jpg (6.08 KiB) Viewed 2774 times
muestra correctamente el dialogo pero al descargar el archivo no se puede descargar en la ruta seleccionada
por el codigo mostrado arriba, tampoco permite sobreescribir el mismo.

Code: Select all

IF .NOT. oPart:detachFile( cCurrentFolder+'\Attachment' )
                  MsgExclamation('Could not save the file : ' + oPart:getFileName() , ' !! Warning Message ¡¡ ' )
                ENDIF
Figura:
!! Warning Message ¡¡ _2013-02-13_21-32-13.jpg
!! Warning Message ¡¡ _2013-02-13_21-32-13.jpg (10.65 KiB) Viewed 2774 times
despues de intentar descarga el adjunto se cambia el directorio por defecto.

2) al hacer doble click en el grid para recuperar el mensaje / email el mismo presenta el contenido pero dice
"Plain Text" siendo que es "HTML", al hacer otra vez doble click presenta su contenido correctamente.

3) Los contenidos HTML con adjunto permite su descarga pero el cuerpo de mensaje / email no es mostrado.

a pesar que consulte en la lista de Harbour User no encontre repuesta a mis consulta ya que puede ser que nadie
tenga experiencia en la libreria HBTIP, que es dificil su uso y no se encuentra una documentacion sobre el uso de
la misma.

4) Mi archivo C:\hmg.3.1.1\hmg.hbc contiene las siguiente inclusiones

Code: Select all

libs=hbssl
libs=libeay32
libs=ssleay32
Libs=hbtip
Libs=hbtipssl
5) Mi archivo C:\hmg.3.1.1\SOURCE\SET_COMPILE_HMG_UNICODE.ch tiene las siguiente modificacion

Code: Select all

//#define COMPILE_HMG_UNICODE
6) si fueron modificados estos archivos es necesario recompilar los fuentes mediante buildlib.bat

***********************************************
Mi humilde aporte para HMGforum
Codigo fuente :
InOutEmail.rar
(231.05 KiB) Downloaded 380 times
***********************************************




*****************************************************************
************************ Translate Google *************************
*****************************************************************

Hi all:
lately a lot of people still have problems with POP servers support SSL.
for the example to work you must have OpenSSL can be downloaded from here.
Win32 OpenSSL v1.0.1e Light : Simple version
Win32 OpenSSL v1.0.1e : Full Version Developer
remember that in the case of Gmail is necessary to go to control panel and enable POP account
find "Enable Gmail Pop" by Google.com for more accuracy
Still contains some errors that are fixable.
1) to attach files by

Code: Select all

/*****************************************************************************/ 
Procedure SelectaFile()
/*****************************************************************************/
   aAFileSend := Getfile ( { {'All Files','*.*'} } , 'Select File(s) Attachment' ;
	                                  , cCurrentFolder +'\SelectAFile' , .t. , .f. )
Return
Figure:
_2013-02-13_20-47-16.jpg
_2013-02-13_20-47-16.jpg (6.08 KiB) Viewed 2774 times
dialogue displays correctly but when downloading the file can not be downloaded in the selected route
by the code above, it does not allow overwriting.

Code: Select all

IF .NOT. oPart:detachFile( cCurrentFolder+'\Attachment' )
                  MsgExclamation('Could not save the file : ' + oPart:getFileName() , ' !! Warning Message ¡¡ ' )
                ENDIF
Figure:
!! Warning Message ¡¡ _2013-02-13_21-32-13.jpg
!! Warning Message ¡¡ _2013-02-13_21-32-13.jpg (10.65 KiB) Viewed 2774 times
after trying to download the attachment changes the default directory.

2) when you double click on the grid to retrieve the message / email the same content presented but says
"Plain Text" is being "HTML", when you double click again presents its contents properly.

3) The contents HTML attachment allows downloading but the body of message / email is not shown.

although consult the list of User Harbour did not find answer to my query as it may be that no
has experience HBTIP library, which is difficult to use and not found a documentation on the use of
thereof.

4) My file C:\hmg.3.1.1\hmg.hbc contains the following inclusions

Code: Select all

libs=hbssl
libs=libeay32
libs=ssleay32
Libs=hbtip
Libs=hbtipssl
5) My file C:\hmg.3.1.1\SOURCE\SET_COMPILE_HMG_UNICODE.ch has the following modification

Code: Select all

//#define COMPILE_HMG_UNICODE
6) If these files were modified to recompile the sources by buildlib.bat

*******************************************************
My humble contribution to HMGforum
Source Code :
InOutEmail.rar
(231.05 KiB) Downloaded 380 times
*******************************************************
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Post Reply