How to set up iphone to show messages as read after reading on desktop?

How do I get my iphone to show my yahoo and gmail messages as read after I read them on my desktop? If I read them on my phone, they show up as read on my desktop.
I think you have to set it up as pop3 and enable it on your desktop in web view as well.

I hope somebody else with more knowledge will come along providing more information.
You want to make sure that the email is setup as (and supports) IMAP.

Note also, though, that even it is it set up correctly, there might be a delay between when they are shown as read on one device to when that gets refreshed on the other device.

Original thread: https://forums.imore.com/threads/how-to-set-up-iphone-to-show-messages-as-read-after-reading-on-desktop.371330/