You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ended up spending several hours trying to make a type that would wrap the SMTPClient type and do the NOOP sending to implement the suggestion in this comment before I realized there was no easy way to track the last time an email was sent for the timer, and you cannot do that by wrapping a SMTPClient because the email type is what sends the email in Email.Send, by calling an an unexported internal function. This means that I need to create a special EmailProvider which returns a new type embedding Email so that I can wrap Email.Send and Email.SendEnvelopeFrom to track the SMTPClient with a mutex and reset the loop. Also SMTPClient has an exported Client field, which returns the unexported internal smtpClient type, which is unfortunately useless. So I cannot have the SMTPServer reconnect the internal smtpClient, and I must use EmailProvider to do that. It's a bit convoluted and not nearly as easy as the solution in #23 would suggest.
It would be nice if there was a way to do this in the library, or if you could provide a type like my EmailProvider that wraps the client and server objects to re-create it when necessary.
The text was updated successfully, but these errors were encountered:
Yes, need to be done in the package, I can restore an early implementation from older laptop that currently works in production.
Currently I'm too busy, I hope have time in January 2023.
I remember the solution was very simple in the package. Doesn't need any change or new type, current code will be working and developer can send emails in same connection in bulk without need to make a NOOP or reconnect, only using the same connection.
I ended up spending several hours trying to make a type that would wrap the
SMTPClient
type and do the NOOP sending to implement the suggestion in this comment before I realized there was no easy way to track the last time an email was sent for the timer, and you cannot do that by wrapping aSMTPClient
because the email type is what sends the email inEmail.Send
, by calling an an unexported internal function. This means that I need to create a specialEmailProvider
which returns a new type embeddingEmail
so that I can wrapEmail.Send
andEmail.SendEnvelopeFrom
to track theSMTPClient
with a mutex and reset the loop. AlsoSMTPClient
has an exportedClient
field, which returns the unexported internalsmtpClient
type, which is unfortunately useless. So I cannot have theSMTPServer
reconnect the internalsmtpClient
, and I must useEmailProvider
to do that. It's a bit convoluted and not nearly as easy as the solution in #23 would suggest.It would be nice if there was a way to do this in the library, or if you could provide a type like my
EmailProvider
that wraps the client and server objects to re-create it when necessary.The text was updated successfully, but these errors were encountered: