Receiving email and downloading attachment through a C# Application

后端 未结 4 1975
再見小時候
再見小時候 2021-02-02 16:44

I am trying to implement a WPF application which can receive the mails sent to a specific email address. The scenario is that, the user will send a PPT file as an attachment to

4条回答
  •  有刺的猬
    2021-02-02 17:19

    var client = new POPClient();
    client.Connect("pop.gmail.com", 995, true);
    client.Authenticate("admin@bendytree.com", "YourPasswordHere");
    var count = client.GetMessageCount();
    Message message = client.GetMessage(count);
    Console.WriteLine(message.Headers.Subject);
    

    A simple tip, that you can follow: https://joshwright.com/tips/tips-sending-receiving-email-in-csharp/

提交回复
热议问题