Skip to content

Commit

Permalink
Client in goroutine argument in send() for check SendTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
xhit committed Sep 17, 2019
1 parent e5903f3 commit cada17e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions email.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ func send(from string, to []string, msg string, sendTimeout int, c *Client, keep

smtpSendChannel = make(chan error, 1)

go func() {
go func(c *Client) {
// Set the sender
if err := c.Mail(from); err != nil {
smtpSendChannel <- err
Expand Down Expand Up @@ -770,7 +770,7 @@ func send(from string, to []string, msg string, sendTimeout int, c *Client, keep

smtpSendChannel <- err

}()
}(c)

select {
case sendError := <-smtpSendChannel:
Expand Down

0 comments on commit cada17e

Please sign in to comment.