0 votes

Hi,
I'm trying to create in vb.net a form that reads the inbox and determines if the email (X@gmail.com) has sent an email. Then it reviews the sent folder and, if a response has not been sent, alerts me of it.

I do that every five minutes and it warns me if there is no answer after fifteen minutes, but I just want one warning, not one every fifteen minutes.

Can you help me on that?

by (200 points)
edited by

1 Answer

0 votes

Most likely you should use a database to store this kind of information.
When email was received, when was the response sent, and finally when was the last time the notification has been sent.

The easy way out in case you are using Gmail would be to label messages with specific labels and act on that:

Label message with Gmail label:
https://www.limilabs.com/blog/label-message-with-gmail-label

Get Gmail labels for specif email:
https://www.limilabs.com/blog/get-gmail-labels-for-specified-messages

Most other IMAP servers support Flags (e.g. Flag.Flagged, Flag.Star).

You may use Imap.FlagMessageByUID to flag a message and Imap.GetFlagsByUID to obtain flags with the IMAP client.

by (297k points)
...