mirror of
https://github.com/knadh/listmonk.git
synced 2025-10-06 13:26:17 +08:00
Update email.go
This commit is contained in:
parent
02da11104d
commit
491a3db0dc
1 changed files with 13 additions and 0 deletions
|
@ -190,6 +190,19 @@ func (e *Emailer) Flush() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Retrieve the retry delay from the configuration
|
||||||
|
retryDelay := time.Duration(config.RetryDelay) * time.Second
|
||||||
|
|
||||||
|
// Implement retry logic
|
||||||
|
var err error
|
||||||
|
for i := 0; i < maxRetries; i++ {
|
||||||
|
err = sendSMTPMail(...)
|
||||||
|
if err == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
time.Sleep(retryDelay) // Wait for the retry delay before the next attempt
|
||||||
|
}
|
||||||
|
|
||||||
// Close closes the SMTP pools.
|
// Close closes the SMTP pools.
|
||||||
func (e *Emailer) Close() error {
|
func (e *Emailer) Close() error {
|
||||||
for _, s := range e.servers {
|
for _, s := range e.servers {
|
||||||
|
|
Loading…
Add table
Reference in a new issue