mirror of
https://github.com/h44z/wg-portal
synced 2025-02-26 05:49:14 +00:00
increase smtp timeout to 30 seconds
This commit is contained in:
parent
9a420d26e1
commit
0d4e12a6c1
@ -4,6 +4,7 @@ import (
|
|||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
mail "github.com/xhit/go-simple-mail/v2"
|
mail "github.com/xhit/go-simple-mail/v2"
|
||||||
@ -47,6 +48,8 @@ type MailAttachment struct {
|
|||||||
func SendEmailWithAttachments(cfg MailConfig, sender, replyTo, subject, body, htmlBody string, receivers []string, attachments []MailAttachment) error {
|
func SendEmailWithAttachments(cfg MailConfig, sender, replyTo, subject, body, htmlBody string, receivers []string, attachments []MailAttachment) error {
|
||||||
srv := mail.NewSMTPClient()
|
srv := mail.NewSMTPClient()
|
||||||
|
|
||||||
|
srv.ConnectTimeout = 30 * time.Second
|
||||||
|
srv.SendTimeout = 30 * time.Second
|
||||||
srv.Host = cfg.Host
|
srv.Host = cfg.Host
|
||||||
srv.Port = cfg.Port
|
srv.Port = cfg.Port
|
||||||
srv.Username = cfg.Username
|
srv.Username = cfg.Username
|
||||||
|
Loading…
Reference in New Issue
Block a user