Get email.
Moderator: Rathinagiri
- zolysoftsolutions
- Posts: 139
- Joined: Wed Feb 29, 2012 3:33 am
- Location: Gyulakuta, Erdélyország
- Contact:
Get email.
Hi all.
Can I recive email trough a HMG application?
I know that can send email, but I have to recieve too..I need to store the name of the sender and the subject in some way.
Thank you.
Best regards,
Zoli B.
Can I recive email trough a HMG application?
I know that can send email, but I have to recieve too..I need to store the name of the sender and the subject in some way.
Thank you.
Best regards,
Zoli B.
_______________________________
Open eyes for you!
Open eyes for you!
Re: Get email.
Hi Zoli,
You can use the hbtip, look at a small example:
You can use the hbtip, look at a small example:
Code: Select all
********************************************
* Compilar: hbmk2 demo.prg -lhbtip
********************************************
PROCEDURE Main
LOCAL oPop, oPart, aParts, oTIpMail, aEmails, i, cFrom, cMsg, n_i
LOCAL cUser:="toledo@pctoledo.com.br"
LOCAL cSenha:="password"
LOCAL cServer:="pop.pctoledo.com.br"
CLS
oPop := TIpClientPop():new( "pop://"+strtran(cUser,"@","&at;")+":"+cSenha+"@"+cServer )
IF EMPTY( oPop )
Alert("Erro ao criar objeto oPop")
RETURN
ENDIF
oPop:oUrl:cUserid = cUser
oPop:nConnTimeout = -1
IF !oPop:Open()
Alert("Erro na abertura da conta oPop")
RETURN
ENDIF
aEMails := oPop:retrieveAll()
oPop:close()
nTot:=Len( aEMails )
// Show only 3 posts
If nTot>3
nTot:=3
Endif
// To show all posts, delete these lines
FOR i:=1 TO nTot
oTIpMail := aEmails[i]
cFrom:=oTIpMail:getFieldPart( "From" )
cSubject:=oTIpMail:getFieldPart( "Subject" )
IF oTIpMail:isMultiPart()
aParts := oTIpMail:getMultiParts()
FOR EACH oPart IN aParts
cMsg:=oPart:getBody()
NEXT
ELSE
cMsg:=oTIpMail:getBody()
ENDIF
? "From: ",cFrom, " - Subject: ",cSubject
// Limit 500 characters
? subs(cMsg,1,500)
? ""
NEXT
RETURN
- zolysoftsolutions
- Posts: 139
- Joined: Wed Feb 29, 2012 3:33 am
- Location: Gyulakuta, Erdélyország
- Contact:
Re: Get email.
Deat masters,
Thks but any suggestion to get the attachments ?
Tia
Best rgds
Chang
Thks but any suggestion to get the attachments ?
Tia
Best rgds
Chang
Just Hmg It !
Re: Get email.
Dear Mr. Toledo...
I tried your code with gmail and yahoo...
but unfortunately no luck...
Pls advise me on how to do it for gmail and yahoo...
( pop.gmail.com and pop.mail.yahoo.com) ?
TIA
best rgds,
Chang
I tried your code with gmail and yahoo...
but unfortunately no luck...
Pls advise me on how to do it for gmail and yahoo...
( pop.gmail.com and pop.mail.yahoo.com) ?
TIA
best rgds,
Chang
Just Hmg It !
Re: Get email.
I think, You've got problem with user login containing "@" character.
Did you tried this solution:
viewtopic.php?f=5&t=2573" onclick="window.open(this.href);return false;
Did you tried this solution:
viewtopic.php?f=5&t=2573" onclick="window.open(this.href);return false;
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: Get email.
now I'm not at home, when you get to upload a working example servers yahoo, gmail and outlook.com (hotmail)
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: Get email.
Hi Chang :hmgchang wrote:I tried your code with gmail and yahoo...
but unfortunately no luck...
Yahoo, Gmail and Hotmail and other services like email generalmentes use the HTTPs protocol //, POPs: // and SMTPs: // for secure connections.
read http://en.wikipedia.org/wiki/Transport_Layer_Security
it needs also the library HbSSL with HbTip together to try to communicate your application with the mail server.
this applies safety and that no other person sees your username and password and other data sent through the unsafe area such as the Internet.
unzip the libraries in their respective folders within your installation HMG.3.3.1 : replace hmb.hbc to include these new libraries and rebuild the libraries using buildalllib.bat and buildalllib64.bat
add these lines to your application
Code: Select all
#include 'hmg.ch'
#include 'hfcl.ch'
#include "hbclass.ch"
#include "simpleio.ch"
#require "hbtip"
#require "hbssl"
REQUEST __HBEXTERN__HBSSL__
Function main
...
Return
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Re: Get email.
Thks Masters,
I download and follow the instructions...
it compiled successfully... but get this message :
[img]
[/img]
TIA
best rgds,
Chang
I download and follow the instructions...
it compiled successfully... but get this message :
[img]
[/img]
TIA
best rgds,
Chang
- Attachments
-
- SslEay32.JPG (19.03 KiB) Viewed 4298 times
Just Hmg It !
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Get email.
So, we got an emailing application ready. Super!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.