Skip to content

Commit

Permalink
readme: update server example to get errors from smtp
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored Jul 7, 2023
1 parent 9e949e0 commit b4236a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,23 @@ func (s *Session) AuthPlain(username, password string) error {

func (s *Session) Mail(from string, opts *smtp.MailOptions) error {
if !s.auth {
return ErrAuthRequired
return smtp.ErrAuthRequired
}
log.Println("Mail from:", from)
return nil
}

func (s *Session) Rcpt(to string) error {
if !s.auth {
return ErrAuthRequired
return smtp.ErrAuthRequired
}
log.Println("Rcpt to:", to)
return nil
}

func (s *Session) Data(r io.Reader) error {
if !s.auth {
return ErrAuthRequired
return smtp.ErrAuthRequired
}
if b, err := ioutil.ReadAll(r); err != nil {
return err
Expand Down

0 comments on commit b4236a6

Please sign in to comment.