Skip to content

Commit c43c4c3

Browse files
committed
readme: drop unencrypted client example
We don't want to encourage people to turn TLS off.
1 parent b4f3805 commit c43c4c3

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

README.md

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -45,40 +45,7 @@ func main() {
4545
}
4646
```
4747

48-
If you need more control, you can use `Client` instead. For example, if you
49-
want to send an email via a server without TLS or auth support, you can do
50-
something like this:
51-
52-
```go
53-
package main
54-
55-
import (
56-
"log"
57-
"strings"
58-
59-
"github.com/emersion/go-smtp"
60-
)
61-
62-
func main() {
63-
// Setup an unencrypted connection to a local mail server.
64-
c, err := smtp.Dial("localhost:25")
65-
if err != nil {
66-
return err
67-
}
68-
defer c.Close()
69-
70-
// Set the sender and recipient, and send the email all in one step.
71-
to := []string{"recipient@example.net"}
72-
msg := strings.NewReader("To: recipient@example.net\r\n" +
73-
"Subject: discount Gophers!\r\n" +
74-
"\r\n" +
75-
"This is the email body.\r\n")
76-
err := c.SendMail("sender@example.org", to, msg)
77-
if err != nil {
78-
log.Fatal(err)
79-
}
80-
}
81-
```
48+
If you need more control, you can use `Client` instead.
8249

8350
### Server
8451

0 commit comments

Comments
 (0)