File tree Expand file tree Collapse file tree 1 file changed +1
-34
lines changed Expand file tree Collapse file tree 1 file changed +1
-34
lines changed Original file line number Diff line number Diff line change @@ -45,40 +45,7 @@ func main() {
45
45
}
46
46
```
47
47
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.
82
49
83
50
### Server
84
51
You can’t perform that action at this time.
0 commit comments