Skip to content

A .NET MAUI app that demonstrates using OAuth2 with Gmail and MailKit for sending and retrieving emails via IMAP and SMTP protocols.

License

Notifications You must be signed in to change notification settings

Detilisi/MailKitOAuthMauiDemo

Repository files navigation

MailKit OAuth Demo

A .NET MAUI demo that integrates Gmail OAuth2 and MailKit for sending and receiving email messages. This application showcases how to implement secure login using OAuth2, enabling users to access their Gmail accounts without compromising security. It utilizes MailKit's SMTP client for composing and sending emails, ensuring reliable delivery, while the IMAP client allows users to fetch and manage their inbox, providing a complete email experience. This demo serves as a practical reference for developers working with authentication and mailing services in cross-platform apps.

Table of Contents

  1. Features
  2. Screenshots
  3. Technologies Used
  4. References
  5. License

Features

  • Secure OAuth2 Authentication: Connect your email account securely using Gmail OAuth2.
  • Email Message Composing and Sending: Utilizes MailKit's SMTP client for reliable email delivery.
  • Email Receiving: Fetches and manages emails using MailKit's IMAP client.
  • .NET MAUI Cross-Platform Compatibility: Seamlessly runs on iOS, Android, and Windows devices.

Screenshots

Connect via OAuth2

The main screen implements open authentication through Gmail's OAuth2, facilitating the secure retrieval of user credentials. These credentials are subsequently utilized to establish connections with MailKit's SMTP and IMAP clients, enabling robust email functionality.

image image

Inbox View

Once authenticated, MailKit's IMAP client connects to the user's email account using secure credentials obtained from the main page, allowing for the retrieval of email messages.

image

Send Email

Similarly, MailKit's SMTP client uses the secure credentials obtained during authentication to successfully send email messages from the user's email account.

image image

Technologies Used

  • .NET MAUI
  • MailKit
  • Google.Apis.Auth
  • CommunityToolkit.Mvvm

References

For more info on "Using OAuth2 With GMail (IMAP, POP3 or SMTP)": MailKit GMail OAuth2 Documentation

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A .NET MAUI app that demonstrates using OAuth2 with Gmail and MailKit for sending and retrieving emails via IMAP and SMTP protocols.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages