I need a simple way to connect to a google email account I create and download all new mail messages. Once the mail messages are downloaded, I want to delete them from Google.
This is a real world app. I have an application that sends messages to clients. For each client, i have setup a google email address used to handle responses.
It's perfectly possible to read Google mail via POP3. You can then use any of the usual methods of accessing POP3 from within VFP. For example, you could use Outlook Automation to retrieve the messages.
For information about reading GMail via POP3, see:
For information about accessing a POP3 mailbox via Outlook, browse the FAQs in this forum, or do a quick search. There are dozens of articles about it floating around.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
*** Connect to the server with username password and retrieve message count
IF !loPOP.Connect()
loProcess.Errormsg("Couldn't connect to mail server",loPop.cErrormsg)
RETURN
ENDIF
IF EMPTY(lcId)
*** Display a message list
IF loPop.nMessageCount > 0
CREATE CURSOR TMessages (Date C(20),From C(80),Subject M,Size C(15),Action M)
FOR m.x =1 TO loPop.nMessageCount
loMsg = loPop.GetMessageHeader(m.x)
INSERT INTO TMessages(Date,From,Subject,Size,Action) VALUES ;
(TIMETOC(loMsg.dDate),loMsg.cFromName, loMsg.cSubject , TRANS(loMsg.nSize/1000,"999,999,999kb"),;
[<a href="WebMail.wwd?MsgID=] + UrlEncode(loMsg.cMsgId) + [">View</a> | ] + ;
[<a href="WebMail.wwd?MsgID=] + UrlEncode(loMsg.cMsgId) + [&Action=Delete">Delete</a>] )
ENDFOR
INDEX ON Date DESCENDING TAG Date
it's true, that SENDING mails is discussed in detail and with lots of options, RECEIVING mails is a rather seldom need.
In addition to your findings, MAPI in general is a solution for working with the different folders including the inbox, not only via Outlook. As you talk of a win2008 server I assume there is no mail client installed whatsoever, it would still make sense to do so in my oppinion, as there is a lot of different features to support, if doing that on your own, not only regarding attachments, but also encodings, signatures and other mime sepcialties, not to talk about spam.
So simply for security reasons it would make sense to use some standard to receive the mail. Optimal would perhaps be to work on the Server Hosting Exchange or Tobit David or other groupware mail solutions - even if you just want to receive mails for one account and even, if only selected mails with certain predetermined mail subjects are loaded.
I have an application that sends messages to clients
Sending the email messages to clients is not too difficult.
It has been discussed many times on this forum.
A Search of the forum will turn up quite a few of those postings.
But the Downloading of email messages in the absence of Outlook as a recipient client is a very different matter.
Far be it for me to question what you or your client's want an application to do, but sometimes asking more questions helps us to focus on answers which best meet your needs(not always the same as what is asked for).
download all new mail messages. Once the mail messages are downloaded, I want to delete them from Google.
My question would be - What are you going to Download the email messages into in the absence of Outlook (or any other email client software) on the execution machine?
And if you get them downloaded, how are you going to display them to the appropriate individuals?
Are you trying to make VFP work as an an automated Email Client in lieu of Outlook (or any other email client software)?
At first glance - I'd suggest that, to make your development life a WHOLE LOT EASIER, you could set up a workstation (physical or virtual) that does indeed have Outlook on it and use it as your VFP Application 'Server' on which to run the VFP application. Then you could do everything through VFP automation of Outlook.
I *think* WIREMESH is saying that he has an application installed on his client's servers that he periodically needs to communicate with via email - perhaps he is sending text updates or some such - and while he can update his application, he cannot install any other software on the remote server or be sure that there is any email client at all, or if there is have any control over it.
If he can modify his application to read the mail, and then delete it, from google mail or whatever - any POP3 mailbox would do presumably - he won't need to install anything else, he might not even have to have a conversation with his client's IT - which would doubtless be prolonged and often fruitless B-)
Personally, I would use Rick Strahl's WestWind stuff, having tried to code with winsock and been very frustrated - but maybe he can't spend any money.
Good luck to him.
Regards
Griff
Keep [Smile]ing
There are 10 kinds of people in the world, those who understand binary and those who don't.
Thanks for the responses. I have an application that sends emails to field techs from potentially hundreds of customers. The field techs are required to reply to the email I send them from my vfp app. I decided to setup a separate email account for each client. I read the client email account (gmail), download the emails, and make updates in a database application. Once the records are updated in the database I will purge the email. In most cases, they will respond with simple text (i.e "be there in 20 minutes").
At some point I may setup a mail server, but for now, I need to demonstrate this asap and I figured gmail or hotmail would be the easiest method. I really don't care if it is gamil, as long as the account is free and easy to access.
Since I don't know what your server was installed to run, I can't say for sure, but as I suggested above, I'd recommend setting up a separate workstation (physical or virtual) to run your VFP application and have Outlook installed there.
In that way it would become your VFP Application 'server' (or a pseuod-server) and its associated files, etc. would be separate from whatever the real server was installed to do.
One of my clients has a similar setup where there are 2 separate dedicated VFP Application 'servers' (one physical workstation and one virtual workstation) - each running their own applications. They both have Outlook on them and each use VFP automation to Send their associated emails (about 200+ each per day) just fine.
Unfortunately those applications do not Receive emails so I can't help you much with that side of things.
One note about using Outlook in an automated manner - periodically check the size of your Outlook PST file to ensure that it doesn't get too big.
With automation running Outlook this can be easily overlooked.
You might want to periodically exchange the PST file with a new 'virgin' one (this is what my client does) or you can Archive off emails and then Compact the file.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.