Way to retreive the mails

Peter_1985 2,711 Reputation points
2025-03-04T04:53:04.7133333+00:00

Hi,

Is it a good way to use SmtpServer and retrieve all of the mails (of a period) to one mail account? And get all of the details of the mails?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,333 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiale Xue - MSFT 49,126 Reputation points Microsoft External Staff
    2025-03-04T06:29:14.0833333+00:00

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.