mirror of
https://github.com/wneessen/go-mail.git
synced 2024-12-23 02:50:39 +01:00
Update Send function documentation for better clarity
Enhanced the documentation of the `Send` function to explicitly describe the behavior when the Client has no active connection and the handling of multiple message transmissions. This ensures developers understand the error handling mechanism and the association of `SendError` with each message.
This commit is contained in:
parent
159c1bf850
commit
fa3c6f956e
2 changed files with 8 additions and 2 deletions
|
@ -9,7 +9,10 @@ package mail
|
|||
|
||||
import "errors"
|
||||
|
||||
// Send sends out the mail message
|
||||
// Send attempts to send one or more Msg using the Client connection to the SMTP server.
|
||||
// If the Client has no active connection to the server, Send will fail with an error. For each of the
|
||||
// provided Msg it will associate a SendError to the Msg in case there of a transmission or delivery
|
||||
// error.
|
||||
func (c *Client) Send(messages ...*Msg) error {
|
||||
if err := c.checkConn(); err != nil {
|
||||
return &SendError{Reason: ErrConnCheck, errlist: []error{err}, isTemp: isTempError(err)}
|
||||
|
|
|
@ -11,7 +11,10 @@ import (
|
|||
"errors"
|
||||
)
|
||||
|
||||
// Send sends out the mail message
|
||||
// Send attempts to send one or more Msg using the Client connection to the SMTP server.
|
||||
// If the Client has no active connection to the server, Send will fail with an error. For each of the
|
||||
// provided Msg it will associate a SendError to the Msg in case there of a transmission or delivery
|
||||
// error.
|
||||
func (c *Client) Send(messages ...*Msg) (returnErr error) {
|
||||
if err := c.checkConn(); err != nil {
|
||||
returnErr = &SendError{Reason: ErrConnCheck, errlist: []error{err}, isTemp: isTempError(err)}
|
||||
|
|
Loading…
Reference in a new issue