cosullivan / SmtpServer

A SMTP Server component written in C#
MIT License
692 stars 163 forks source link

Feat: Programmable API #122

Closed ryanelian closed 4 years ago

ryanelian commented 4 years ago

Hello,

First of all, thank you for writing this very exciting project. I'm thrilled by the possibilities unlocked when developing against this library.

I've noticed that this library basically spawns an SMTP server on a port. What I've wondered is: would it be possible to interact with the SMTP server instance without using SMTP protocol?

For example: SendMailAsync method is available which accepts an object and directly sends an email without the network call. This allows developing a ASP.NET Core Web API which accepts mail-like JSON object which sends an email later.

Are there non-documented methods available to do this or is it possible for we to have such method in this library?

cosullivan commented 4 years ago

Hi @ryanelian,

The whole purpose of this library is to handle the SMTP protocol and then pass the message off to your own implementation of something that handles the message. Therefore I'm not sure if there is any benefit to having an API to bypass the SMTP protocol as the library would almost do nothing.

This library itself doesn't send the messages, you would need to implement that yourself.

Thanks, Cain.