Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seeking email client which files emails separately
Message
General information
Forum:
Visual FoxPro
Category:
Third party products
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01596204
Message ID:
01596687
Views:
151
>For some time I have been using an application called Smartserver which connects to an email pop server and retrieves the emails and files them all separately as text files in a given folder. Sadly this is a 16 bit application and I need to find a replacement - any ideas?
   * lcURL=[http://www.myWebSite.com/MyEMailRetriever.ASP]
   * lcWebSeriveCDO = request parameters to point to boxes and messages in xml  container (or CSV)
   * lcSendCDOMailBoxParms = a simple xml with necessary CDO mailbox and mail item pointers
   oHTTP=NewOBJECT("MSXML2.XMLHTTP")
   oHTTP.open([POST],lcURL,.f.) && Note the POST method indicating a request package
                                                && is attached. If the parameter list is tiny, you could 
                                                && use the GET method.
   oHttp.setRequestHeader("Content-Type", "text/xml")
   oHttp.send(lcSendCDOMailBoxParms)
   * lcResponseText is the email, or series of emails in an XML or CSV returned by www.myWebSite.com/MyEMailRetriever.ASP
   lcResponseText = oHTTP.Response
At the top of the Web Service in Classic ASP example:
-* Receiving the mail box and mail item parameters from the VFP client (hint - they're 3 parameters in the in the Request var that were posted by the VP client in the lcSendCDOMailBoxParms string ). THe HTM tag should read HTML
(!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN")
(html)(head)
(% Response.Expires = 0

dim oXML
set oXML = Server.CreateObject("Msxml2.DOMDocument")
oXML.async = false
oXML.resolveExternals = false
oXML.load(Request)
dim oItems,cParm1,cParm2, cParm3
set oItems=oXML.selectSingleNode("row") 
cParm1=oItems.selectSingleNode("Parm1).text
cParm2=oItems.selectSingleNode("Parm2").text
cParm3=oItems.selectSingleNode("Parm3").text
There's a lot of info on the CDO MailBox and MailItem pointers - did not have time to run them down. The might be addressed just like a CDO relay request message object property names: "To", "From", "Bcc", "Subject", Textbody", etc. Design issues may include what to do with an email that has been downloaded to a client folder. Should it be moved to another mailbox, deleted, or allowed to remain in the receiving box. If it is moved or deleted, then every time the VFP client runs an email retrieval it begin with the first Mail Item. If not, that last retrieved mail item index would need to be hard stored by the client or in a server sql table.

So leats assume your web service has cycled through one or all the mail items and cocancenated the data into an XML or HTML, in a string named cReturnPage and now need to have them returned to your VFP client's oHTTP.ResponseText property - what to do?

Using ASP classic you'd close the ASP session connections with the corresponding "%>"
Remaber that opening
oConn.close
Set oConn = Nothing
Set oRs = Nothing
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
%)
(title)(/title)
(meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1")(/head)
(body)
cReturnPage
(/body)(/html)
Don't know that a simple line instruction like cReturnPage will work, the returned email content may have to be "literally" parsed to HTML tags- it's been so long.or call a JS script that would insert an xml string inside a element ID.

Don't like figuring out 3rd party products - so - if you be wanting to roll your own using method like the one above.My grand pappy used to say it ain't abount the answer, it's always about the question.
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform