|
@@ -55,6 +55,23 @@ e := NewEmail()
|
|
e.AttachFile("test.txt")
|
|
e.AttachFile("test.txt")
|
|
```
|
|
```
|
|
|
|
|
|
|
|
+#### A Pool of Reusable Connections
|
|
|
|
+```
|
|
|
|
+(var ch <-chan *email.Email)
|
|
|
|
+p := email.NewPool(
|
|
|
|
+ "smtp.gmail.com:587",
|
|
|
|
+ 4,
|
|
|
|
+ smtp.PlainAuth("", "test@gmail.com", "password123", "smtp.gmail.com"),
|
|
|
|
+)
|
|
|
|
+for i := 0; i < 4; i++ {
|
|
|
|
+ go func() {
|
|
|
|
+ for e := range ch {
|
|
|
|
+ p.Send(e, 10 * time.Second)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+```
|
|
|
|
+
|
|
### Documentation
|
|
### Documentation
|
|
[http://godoc.org/github.com/jordan-wright/email](http://godoc.org/github.com/jordan-wright/email)
|
|
[http://godoc.org/github.com/jordan-wright/email](http://godoc.org/github.com/jordan-wright/email)
|
|
|
|
|
|
@@ -64,4 +81,4 @@ Sections inspired by the handy [gophermail](https://github.com/jpoehls/gophermai
|
|
### Contributors
|
|
### Contributors
|
|
I'd like to thank all the [contributors and maintainers](https://github.com/jordan-wright/email/graphs/contributors) of this package.
|
|
I'd like to thank all the [contributors and maintainers](https://github.com/jordan-wright/email/graphs/contributors) of this package.
|
|
|
|
|
|
-A special thanks goes out to Jed Denlea [jeddenlea](https://github.com/jeddenlea) for his numerous contributions and optimizations.
|
|
|
|
|
|
+A special thanks goes out to Jed Denlea [jeddenlea](https://github.com/jeddenlea) for his numerous contributions and optimizations.
|