Usman Waheed
Usman Waheed

Reputation: 553

Handle Gmail (Send/Receive) in Win Forms

For certain reasons I want to develop Gmail desktop application for my self in C#. So that I can retrieve email (including attachments) (I dont want to use outlook/thunderbird etc. clients for desktop)

So please suggest what is better option, so far I have got following two where I can start:

https://developers.google.com/gmail/api/quickstart/dotnet#step_1_turn_on_the_api_name

https://gmailerxp.codeplex.com/

Upvotes: 4

Views: 109

Answers (2)

Rashik Hasnat
Rashik Hasnat

Reputation: 327

Try DevMvcComponent 3.0

Install-Package DevMVCComponent

use this readme at https://github.com/aukgit/DevMvcComponent.

var gmailServer = new GmailServer("[email protected]", "password");
gmailer.QuickSend("[email protected]", "Subject", "HTML body");

You are good to go then.

Upvotes: 5

Tommy
Tommy

Reputation: 3124

Install-Package OpenPop.NET

Take a look of OpenPop.NET: https://github.com/foens/hpop

using (var client = new Pop3Client())
{
    client.Connect("pop.gmail.com", 995, useSsl: true,
        receiveTimeout: 30 * 1000, sendTimeout: 60 * 1000,
        certificateValidator: null);

    client.Authenticate("username", "password");

    var messageUids = client.GetMessageUids();
    foreach (var messageUid : messageUids)
    {
        Console.WriteLine("Received email: " + messageUid);
    }
}

You have to lower your account security if using custom-made programs. https://support.google.com/accounts/answer/6010255?hl=en

Upvotes: 0

Related Questions