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.
- 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.
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.
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.
Similarly, MailKit's SMTP client uses the secure credentials obtained during authentication to successfully send email messages from the user's email account.
- .NET MAUI
- MailKit
- Google.Apis.Auth
- CommunityToolkit.Mvvm
For more info on "Using OAuth2 With GMail (IMAP, POP3 or SMTP)": MailKit GMail OAuth2 Documentation
This project is licensed under the MIT License. See the LICENSE file for details.