From c43c4c3e1b6bd2098a9fb55adad9421902a80ca8 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 24 Aug 2023 08:01:07 +0200 Subject: [PATCH] readme: drop unencrypted client example We don't want to encourage people to turn TLS off. --- README.md | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/README.md b/README.md index a5a1792..daeef79 100644 --- a/README.md +++ b/README.md @@ -45,40 +45,7 @@ func main() { } ``` -If you need more control, you can use `Client` instead. For example, if you -want to send an email via a server without TLS or auth support, you can do -something like this: - -```go -package main - -import ( - "log" - "strings" - - "github.com/emersion/go-smtp" -) - -func main() { - // Setup an unencrypted connection to a local mail server. - c, err := smtp.Dial("localhost:25") - if err != nil { - return err - } - defer c.Close() - - // Set the sender and recipient, and send the email all in one step. - to := []string{"recipient@example.net"} - msg := strings.NewReader("To: recipient@example.net\r\n" + - "Subject: discount Gophers!\r\n" + - "\r\n" + - "This is the email body.\r\n") - err := c.SendMail("sender@example.org", to, msg) - if err != nil { - log.Fatal(err) - } -} -``` +If you need more control, you can use `Client` instead. ### Server