Leer mails

Post Reply
Enrrique Vertiz
Posts: 562
Joined: Fri Oct 07, 2005 2:17 pm
Location: Lima - Peru
Been thanked: 3 times
Contact:

Leer mails

Post by Enrrique Vertiz »

Estimados, consulta

He tratado con la ayuda de la IA de crear una funcion para leer correos, de una cuenta nuestra, pop3, gmail, en fin lo ideal desde cualquier cuenta, la idea es leer el asunto, contenido y descargar el archivo adjunto para automatizar un proceso ... pero el codigo que me dan da errores y lo que usan TSocket o Curl no es algo que maneje muy bien ... alguien tendra un ejemplo de como leer correos ?
Gracias
Enrrique Vertiz Pitta
Lima-Peru
xHb 1.23.1026X, Fwh 25.01, BCC74, MySQL 8.0.X, SQLLIB 1.9m
User avatar
Antonio Linares
Site Admin
Posts: 42723
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 93 times
Been thanked: 106 times
Contact:

Re: Leer mails

Post by Antonio Linares »

Estimado Enrique,

En FWH 25.01 en la carpeta FWH\samples\gmail\ tienes un ejemplo completo testgmail.prg desarrollado por Lailton.

Si no tienes dicha carpeta, contacta conmigo por whatsapp y te la facilito.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Enrrique Vertiz
Posts: 562
Joined: Fri Oct 07, 2005 2:17 pm
Location: Lima - Peru
Been thanked: 3 times
Contact:

Re: Leer mails

Post by Enrrique Vertiz »

Gracias, no la tengo, ya te escribi
Enrrique Vertiz Pitta
Lima-Peru
xHb 1.23.1026X, Fwh 25.01, BCC74, MySQL 8.0.X, SQLLIB 1.9m
Enrrique Vertiz
Posts: 562
Joined: Fri Oct 07, 2005 2:17 pm
Location: Lima - Peru
Been thanked: 3 times
Contact:

Re: Leer mails

Post by Enrrique Vertiz »

Saludos Antonio

Me sale error al compilar Testgmail, el mismo con xHarbour y Harbour, pregunte a la IA y me dice que revise el archivo prsht.h que es de Borland 77 ??, pero este mensaje solo sale con este prg, compile todos los samples y compilan casi todos y algunos dan error, pero no este, que podra ser ?? (abajo la line de error)

Error prsht.h 918 9: '#endif' before '#if'
* Linking errors *
Enrrique Vertiz Pitta
Lima-Peru
xHb 1.23.1026X, Fwh 25.01, BCC74, MySQL 8.0.X, SQLLIB 1.9m
User avatar
Antonio Linares
Site Admin
Posts: 42723
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 93 times
Been thanked: 106 times
Contact:

Re: Leer mails

Post by Antonio Linares »

Enrique,

Modifica testgmail.rc así:

Code: Select all | Expand

#include <windows.h>

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

GMAIL DIALOGEX DISCARDABLE 6, 18, 346, 78
STYLE DS_SHELLFONT|WS_POPUP|DS_MODALFRAME|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "GMAIL oAUTH"
FONT 8, "Tahoma"
{
  CONTROL "Connect with Gmail", 4001, "Button", WS_TABSTOP, 103, 21, 140, 36
  CONTROL "", 4002, "Static", SS_BITMAP|SS_CENTERIMAGE|WS_BORDER, 8, 8, 60, 60
  CONTROL "This is a label:", 4003, "Static", WS_GROUP, 76, 8, 200, 8
  CONTROL "This is a label:", 4004, "Static", WS_GROUP, 76, 24, 200, 8
  CONTROL "Disconnect", 4005, "Button", WS_TABSTOP, 80, 52, 56, 14
  CONTROL "Send Mail", 4006, "Button", WS_TABSTOP, 280, 4, 58, 20
}
y copia libcurl.dll desde FWH\samples a esa carpeta
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42723
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 93 times
Been thanked: 106 times
Contact:

Re: Leer mails

Post by Antonio Linares »

Para construirlo:

go.bat

Code: Select all | Expand

set path=c:\bcc77\bin
c:\harbour\bin\win\bcc\hbmk2 testgmail.hbp -comp=bcc
testgmail.hbp

Code: Select all | Expand

-gui

-Ic:\fwh\include

testgmail.prg
testgmail.rc

-Lc:\fwh\lib
-lFiveH
-lFiveHC

xhb.hbc
hbct.hbc
hbmzip.hbc
hbziparc.hbc
hbcurl.hbc
regards, saludos

Antonio Linares
www.fivetechsoft.com
Enrrique Vertiz
Posts: 562
Joined: Fri Oct 07, 2005 2:17 pm
Location: Lima - Peru
Been thanked: 3 times
Contact:

Re: Leer mails

Post by Enrrique Vertiz »

Gracias, ya compilo, vamos a cambiar las credenciales y probar.
Enrrique Vertiz Pitta
Lima-Peru
xHb 1.23.1026X, Fwh 25.01, BCC74, MySQL 8.0.X, SQLLIB 1.9m
Post Reply