Search Email Inbox with C#

Note (2025): This post dates back to 2014 and uses password‑based IMAP access for Gmail. Modern Gmail/Google Workspace typically requires OAuth 2.0 and app passwords/“less secure apps” are disabled. The example is kept for archival purposes; adapt authentication accordingly in new projects. A few years ago I helped manage a radio and I needed a tool—an ASP.NET web page—for the periodical download of promo mixes. They were linked in emails recognizable by a few keywords. ...

March 27, 2014 · 1 min · Andrea Azzola

Call async methods with C#

Note: This article was originally written in 2009 and may be obsolete due to C# technology improvements. This article shows how to delegate work to an asynchronous thread in C#, allowing for code execution and app responsiveness. You might go a step further by implementing error notifications, polling, or waiting for the procedure to complete at a certain point. Suppose you have the following method: public void UploadFile(string path) { try { //... uploads some file to the server } catch(Exception ex) { // ... handle errors } } And you are implementing it as a web service: you are asked to give an immediate response and upload the file asynchronously, as the user won’t need the upload immediately. ...

October 15, 2009 · 1 min · Andrea Azzola