Robert Godfrey 3 February 2025 | 2 mins to read

Integrating SMTP and SendGrid in ASP.NET Core

3 February 2025
Email
0 Comments

In the latest update to my web application, I integrated SMTP and SendGrid to enhance email functionality. This allows administrators to configure email settings dynamically, select a default email provider, and send test emails from either provider—all from within the Admin panel.

SMTP Integration with Microsoft 365: The application now supports email delivery via Microsoft 365 SMTP. However, as Microsoft has deprecated Basic Authentication, I will be migrating SMTP authentication to OAuth in future updates.

SendGrid Integration: To improve email scalability and deliverability, I also integrated SendGrid. This enables API-based email sending, with settings that can be customized directly in the application.

The updated email configuration supports the following features:

  • Dynamic email provider selection (SMTP or SendGrid)
  • Customizable SMTP and SendGrid settings
  • The ability to send test emails using either provider
  • Demo Data for Testing: Currently, email settings are stored as demonstration data until encryption and security enhancements are implemented. This allows testing without affecting live credentials. Future updates will secure and encrypt email configurations.

    Future Plans: To further improve security and functionality, I plan to implement:

  • OAuth authentication for SMTP
  • Enhanced email logging and tracking
  • Encrypted storage of email settings
  • More detailed admin control over email configurations
  • For more details on setting up SMTP and SendGrid, refer to the following resources:

    Screenshots have been provided to highlight the changes and updates to the application.

    Robert Godfrey IT Leader
    First, a disclaimer – the entire process of writing a blog post often takes more than a couple of hours, even if you can type eighty words per minute and your writing skills are sharp. I sometimes use AI to assist with refining my content, but not so much as to lose my own thoughts, words, and values. I often refer to this quote when considering how I wish to relay or share my thoughts:
    "Your beliefs become your thoughts. Your thoughts become your words. Your words become your actions. Your actions become your habits. Your habits become your values. Your values become your destiny." - Mahatma Gandhi
    Author’s Profile
    Need Technical Consulting, Reach Out Today!
    Learn more about how I can help with your technical requirements
    Coming Soon

    Need assistance or have questions?

    Contact support for help! support@rgodfrey.com
    © RGodfrey 2024
    We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Updated on December 23, 2022). For more information, see the privacy policy.