Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
to3m
· 11y ago · 0 comments
"GetMailPolicySingleton()->SetSendingMechanism(Email::SMTP)" ;)
Comments
[–]
rescripting
11y ago
Sometimes 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 ago
Singletons have nothing to do with reentrancy or lack thereof.