Ver código fonte

throw an error if the remote is configured for starttls and the server does not have the extension

Mark Gardner 3 anos atrás
pai
commit
32d0206af0
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      smtp.go

+ 2 - 0
smtp.go

@@ -374,6 +374,8 @@ func SendMail(r *Remote, from string, to []string, msg []byte) error {
 			if err = c.StartTLS(config); err != nil {
 				return err
 			}
+		} else if r.Scheme == "starttls" {
+			return errors.New("starttls: server does not support extension, check remote scheme")
 		}
 	}
 	if r.Auth != nil && c.ext != nil {