General Help regarding HMG, Compilation, Linking, Samples
Moderator: Rathinagiri
-
hmgchang
- Posts: 273
- Joined: Tue Aug 13, 2013 4:46 am
- Location: Indonesia
Post
by hmgchang »
This is my ssw :
Code: Select all
#include <hmg.ch>
#include 'hfcl.ch'
#include "hbclass.ch"
#include "simpleio.ch"
#require "hbtip"
#require "hbssl"
REQUEST __HBEXTERN__HBSSL__
Function Main
Load Window Main
Main.Center
Main.Activate
Return
FUNCTION btnGetMail_Action()
// The example outlines the steps required for retrieving all
// eMails from a POP mail server and how to decompose
// incoming mail messages.
LOCAL oPop, oPart, aParts, oTIpMail, aEmails, i
cUser := "hmgchang@gmail.com"
cPassword := "hmg123456"
cPopServer := "pop.gmail.com" && "imap.googlemail.com" &&
cUser := STRTRAN( cUser, "@", "&at;")
cTUrl := "pop://" + cUser + ":" + cPassword + "@" + cPopServer
oUrl := TUrl():New( cTUrl)
IF oUrl == NIL
msgDebug( "Error : " + cTUrl)
RETURN NIL
ENDIF
oPop := TIpClientPop():new( oUrl, .F.)
IF oPop == NIL
msgDebug( "oPop := TIpClientPop():new( oUrl, .F.)")
RETURN NIL
ENDIF
cUser := STRTRAN( cUser, "&at;", "@")
oPop:oUrl:cUserId := cUser
oPop:nConnTimeout := -1
*- oPop := TIpClientPop():new( "pop://mailaccount:password@pop.server.com" )
*- oPop := TIpClientPop():new( "pop://" + cMailAccount + ":" + cPassword + "@" + cPopServer )
IF .NOT. oPop:open()
msgDebug( "Connection error:", oPop:lastErrorMessage(), "oPop:open()")
QUIT
ELSE
aEMails := oPop:retrieveAll()
oPop:close()
ENDIF
FOR i:=1 TO Len( aEMails )
oTIpMail := aEmails[i]
msgDebug( "From : ", oTIpMail:getFieldPart( "From" ))
msgDebug( "Subject : ", oTIpMail:getFieldPart( "Subject" ))
IF oTIpMail:isMultiPart()
// Retrieve all parts of a multipart message
aParts := oTIpMail:getMultiParts()
FOR EACH oPart IN aParts
IF .NOT. Empty( oPart:getFileName() )
// This is a file attachment. Store it in the TMP folder.
IF oPart:detachFile( "C:\tmp\" )
msgDebug( "Attach file :", "File written: C:\tmp\" + oPart:getFileName())
ENDIF
ELSE
msgDebug( "GetBody :", oPart:getBody())
ENDIF
NEXT
ELSE
// simple mail message
msgDebug( "Simple GetBody : ", oTIpMail:getBody())
ENDIF
NEXT
RETURN NIL
I also download and installed the vcredist_x86.exe and Win32OpenSSL_Light-1_0_1i.exe.
But i got this message :
-
Attachments
-
- enetunreach.JPG (19.7 KiB) Viewed 3575 times
Just Hmg It !
-
Javier Tovar
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Post
by Javier Tovar »
Hola DanielMaximiliano,
El primer archivo adjunto no subio?, por que no selecciona nada para bajar.
Saludos
-
danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
-
Contact:
Post
by danielmaximiliano »
Hola Chang... This is my ssw
- message.jpg (21.22 KiB) Viewed 3534 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
-
Javier Tovar
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Post
by Javier Tovar »
Disculpa DanielMaximiliano, es que al traducir la pagina al español, ya no sale tu primer archivo que subiste y mostrando la pagina original SI.
No me di cuenta hasta ahorita.
Saludos
-
hmgchang
- Posts: 273
- Joined: Tue Aug 13, 2013 4:46 am
- Location: Indonesia
Post
by hmgchang »
Thank you very much Master Daniel,
i will download and meditate on it...
best regards,
Chang
Just Hmg It !
-
hmgchang
- Posts: 273
- Joined: Tue Aug 13, 2013 4:46 am
- Location: Indonesia
Post
by hmgchang »
Dear Daniel,
After filling in the user and password...
i tried to run your ssw....
this is what i got..
- Connection Info
- ConnectionInfo.JPG (14.36 KiB) Viewed 3484 times
and this is the ssw...
Pls advise and TIA
best rgds,
Chang
Just Hmg It !
-
hmgchang
- Posts: 273
- Joined: Tue Aug 13, 2013 4:46 am
- Location: Indonesia
Post
by hmgchang »
Dear master,
FYI,...
i can successfully login the gmail account by my browser...
Just Hmg It !
-
danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
-
Contact:
Post
by danielmaximiliano »
hmgchang wrote:Dear Daniel,
After filling in the user and password...
i tried to run your ssw....
this is what i got..
need not indicate @gmail or @gmail.com this server
Code: Select all
cUser := "hmgchang"
cPassword := "hmg123456"
-
Attachments
-
- changuser.jpg (20.04 KiB) Viewed 3464 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
-
hmgchang
- Posts: 273
- Joined: Tue Aug 13, 2013 4:46 am
- Location: Indonesia
Post
by hmgchang »
Dear Daniel....
I tried and it works...
Thank you very much....
and sorry for causing you troubles...
best rgds,
Chang
Just Hmg It !
-
danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
-
Contact:
Post
by danielmaximiliano »
hmgchang wrote:Dear Daniel....
I tried and it works...
Thank you very much....
and sorry for causing you troubles...
best rgds,
Chang
are pleased to help Chang
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO