6 ms·
"GetMailPolicySingleton()->SetSendingMechanism(Email::SMTP)" ;)
by to3m 11y ago
"GetMailPolicySingleton()->SetSendingMechanism(Email::SMTP)" ;)
- rescripting 11y agoSometimes you're sending via SMTP, sometimes via MailGun. If you don't remember to call GetMailPolicySingleton()->SetSendingMechanism() before every email.send() you end up using whatever policy was set last.
- taspeotis 11y ago> Singleton What if two threads need to send mail via SMTP and Mailgun...
- anton_gogolev 11y agoSingletons have nothing to do with reentrancy or lack thereof.