mirror of
				https://github.com/h44z/wg-portal.git
				synced 2025-11-03 23:56:18 +00:00 
			
		
		
		
	increase smtp timeout to 30 seconds
This commit is contained in:
		@@ -4,6 +4,7 @@ import (
 | 
			
		||||
	"crypto/tls"
 | 
			
		||||
	"io"
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/pkg/errors"
 | 
			
		||||
	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 {
 | 
			
		||||
	srv := mail.NewSMTPClient()
 | 
			
		||||
 | 
			
		||||
	srv.ConnectTimeout = 30 * time.Second
 | 
			
		||||
	srv.SendTimeout = 30 * time.Second
 | 
			
		||||
	srv.Host = cfg.Host
 | 
			
		||||
	srv.Port = cfg.Port
 | 
			
		||||
	srv.Username = cfg.Username
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user