Search The ForumSearch   RegisterRegister  LoginLogin

MailBee POP3

 AfterLogic Forum : MailBee POP3
Subject Topic: VFP SSL/POP3 Example Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
nabunod
Newbie
Newbie


Joined: 20 March 2007
Location: United States
Online Status: Offline
Posts: 1
Posted: 20 March 2007 at 11:45am | IP Logged Quote nabunod

If anyone is interested, the following VFP code works successfully to connect via SSL to gmail POP3 accounts.

Code:
* Create POP3 object
oPOP3 = CreateObject("MailBee.POP3")
* Unlock POP3 object
oPOP3.LicenseKey = "yourPOP3licensekey"
* Create SSL object
oSSL = CreateObject("MailBee.SSL")
* Unlock SSL object
oSSL.LicenseKey = "yourSSLlicensekey"
* Set the POP3 Object SSL property to the SSL object
oPOP3.SSL = oSSL
* Enable logging POP3 session into a file
oPOP3.EnableLogging = .T.
oPOP3.LogFilePath = "C:\pop3_log.txt"
* Set POP3 server Variables
oPOP3.ServerName = "pop.gmail.com"
oPOP3.PortNumber = 995
* Set user credentials
oPOP3.UserName = "yourusername@domain.com"
oPOP3.Password = "yourpassword"
* Connect to the server and log in the mailbox
IF oPOP3.Connect()
  * Download first message completely
   oMsg = oPOP3.RetrieveSingleMessage(1)
  IF !oPOP3.IsError()
    * Display message body
    MESSAGEBOX(oMsg.BodyText)
  ELSE
    * Display error information
    MESSAGEBOX( "Error #" + ALLTRIM(STR(oPOP3.ErrCode,10,0)) + ", " + oPOP3.ErrDesc)
  ENDIF
  * Close the connection
  llsuccess = oPOP3.Disconnect()
ELSE
  * Display error information
  MESSAGEBOX("Error #" + ALLTRIM(STR(oPOP3.ErrCode,10,0)))
  MESSAGEBOX("Server response: " + oPOP3.ServerResponse)
ENDIF
RELEASE oPOP3
RELEASE oSSL

*This was translated from the the VB example in the Documentation for use in VFP.


Nabu
Back to Top View nabunod's Profile Search for other posts by nabunod
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 20 March 2007 at 12:10pm | IP Logged Quote Andrew

Thank you for the sample code you provided.


Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide