Source language: Translate to:

Checking Gmail account...

Questions and information about using VBScript and JavaScript in NeoBook functions

Moderator: Neosoft Support

Checking Gmail account...

Postby David de Argentina » Thu Feb 12, 2009 1:52 pm

If you need check Gmail accounts, this sample could you useful for you.
This function calls an ActiveX component called anpop.
This ActiveX could be downloaded at:

http://www.emailarchitect.net/webapp/download/anpop.exe

The main webpage is:

http://www.emailarchitect.net/webapp/popcom/


Save this code on your VBScript Examples\ folder as "anpop"

Code: Select all
{NeoBook Function}
Version=5,60
Language=VBScript
Param=[%1]|Text|Mail Server
Param=[%2]|Text|User
Param=[%3]|Text|Pass
Param=[%4]|Text|Port
Param=[%5]|Text|Server Type
{End}
Dim oPop3
Dim oMsg
Dim nRet
Dim i
Dim nCount
Dim retvalue
Dim param1
Dim param2
Dim param3
Dim param4
Dim param5

param1 = "[%1]"
param2 = "[%2]"
param3 = "[%3]"
param4 = "[%4]"
param5 = "[%5]"

publication.nbSetVar "[mailCount]", 0

Set oPop3 = CreateObject("ANPOP.POPMAIN")
'Set oMsg = CreateObject("ANPOP.POPMSG")

'Unload SSL if exist
call oPop3.SSL_uninit()

'connect settings
oPop3.Timeout = 15
oPop3.ServerPort = param4

if param5 = "IMAP" then
  oPop3.IMAP4Connection = 1
else
  oPop3.IMAP4Connection = 0
end if

If oPop3.SSL_init() <> 0 Then
  retvalue = "Initialize SSL/TLS library failed"
  publication.nbSetVar "status", retvalue
else
  'nRet = oPop3.SecureConnect(param1, param2, param3)
  nRet = oPop3.Connect(param1, param2, param3)
  If nRet <> 0 Then
    retvalue = "Error al Conectar"
    publication.nbSetVar "[status]", retvalue
  else
    nCount = oPop3.GetTotalOfMails()
    If nCount = -1 Then
      retvalue = "Error en GetTotalOfMails method "
      publication.nbSetVar "[status]", retvalue
    else
      if nCount > 0 then
        retvalue = "There are New Messages"
        publication.nbSetVar "[status]", retvalue
        'send to neobook the quantity of messages
        publication.nbSetVar "[mailCount]", nCount
      else
        retvalue = "NO new messages"
        publication.nbSetVar "[status]", retvalue
      end if
    End If
    call oPop3.SSL_uninit()
    oPop3.Close
  End If
end if
set oPop3 = nothing



the NeoBook calling function could be:

Code: Select all
usage:
Call "VBScript Examples\anpop" "[sslPop3]" "[sslUser]" "[sslPass]" "[sslPort]" "[sslType]"

where:
[sslpop3]: is pop.gmail.com for Gmail accounts
[sslUser]: youraccount@gmail.com
[sslPass]: your password
[sslType]: Could be: POP3 or IMAP
for POP3 -> set [sslport] value to 995
for IMAP -> set [sslport] value to 993


My devaluated cent,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby aguilar955 » Fri May 13, 2011 3:28 am

Por mas que intento crear la función no se si la estoy haciendo bien o que esta pasando, no consigo hacerla funcionar me da error.

For more than try to create the role if I'm not doing right or what is happening, I can not run it gives me error.

hpwNBVersion=560.0
sslPop3=pop.gmail.com
sslUser=correo@gmail.com
sslPass=password
sslType=POP3
sslport=995
mailCount=0
LastError=El componente ActiveX no puede crear el objeto: 'ANPOP.POPMAIN'

anpop.7z

http://www.megaupload.com/?d=TPKK3UWL

Salu2
aguilar955
 
Posts: 85
Joined: Sat Jan 17, 2009 10:50 am

Postby domino » Fri May 13, 2011 8:16 am

I've just implemented some POP3 routines for a client and found Alberto's tmPOP3 plugin very good indeed.

http://www.neosoftware.com/neobook/modu ... 12&lid=135
User avatar
domino
 
Posts: 275
Joined: Sat Apr 02, 2005 7:11 am
Location: Notts UK

Postby aguilar955 » Fri May 13, 2011 3:49 pm

domino wrote:I've just implemented some POP3 routines for a client and found Alberto's tmPOP3 plugin very good indeed.

http://www.neosoftware.com/neobook/modu ... 12&lid=135


Thank you very much proves it.
The sorrow that is in doubt because it gives this error.

Greetings
aguilar955
 
Posts: 85
Joined: Sat Jan 17, 2009 10:50 am


Return to NeoBook Functions - VBScript & JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest

cron