NetTalk Central

NetTalk E-Mail => E-Mail - Ask For Help => Topic started by: DonnEdwards on July 08, 2022, 01:29:30 AM

Title: POP3: Deleting yesterday's messages only (SOLVED)
Post by: DonnEdwards on July 08, 2022, 01:29:30 AM
Hi all
I am busy with an app that sends a test email every 5 minutes from 5am to 9pm from the SMTP server mail.mensclinic.co.za to POP3 server mail.petfindsa.co.za. Normally, the mail arrives in seconds, but once the SMTP server gets busy, there can be a delay, anything up to 2 hours. Some of these messages need to arrive within a few minutes because they are being sent to an email-to-sms gateway and the patient has to wait for the SMS to get a one-time pin.

When I send the message, I also write it to a table. A few minutes later, I connect to the POP3 server and start looping through the messages, as demonstrated in the "NetTalk->email->Demo" app and the "NetTalk->email->Email Receive With Dont Download Again" examples.

In the ThisEmailReceive.Done procedure I tried the following:

dtmSentDate       DATE
Code: [Select]
if dtmSentDate < today() then
      self.OptionsDelete = true
      self.DecideToDelete
end

This successfully deleted all the emails, not just the old ones. So I'm obviously not understanding something correctly. Any suggestions, code or advice would be greatly appreciated.


Title: Re: POP3: Deleting yesterday's messages only (SOLVED)
Post by: DonnEdwards on July 08, 2022, 03:25:16 AM
It's amazing what happens when you re-read the manual, in this case
nettalk3.htm#The_NetEmailReceive_Methods

It's working now