NetTalk Central

Author Topic: POP3: Deleting yesterday's messages only (SOLVED)  (Read 3999 times)

DonnEdwards

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Insights and Rants
    • Email
POP3: Deleting yesterday's messages only (SOLVED)
« 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.


« Last Edit: July 08, 2022, 03:23:30 AM by DonnEdwards »
If you're happy with your security, then so are the bad guys

DonnEdwards

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Insights and Rants
    • Email
Re: POP3: Deleting yesterday's messages only (SOLVED)
« Reply #1 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
If you're happy with your security, then so are the bad guys