Hi @Peter_1985 , Welcome to Microsoft Q&A,
Using SmtpServer to retrieve emails is not a good idea, because SMTP (Simple Mail Transfer Protocol) is mainly used to send emails, not receive emails.
You can use Microsoft's Exchange Web Services (EWS) or Microsoft Graph API to receive emails.
You can also use open source APIs such as IMAP.
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.