|
@@ -23,7 +23,24 @@ Plans for the ```email``` package currently include supporting:
|
|
|
*Note: Requires go version 1.1 and above*
|
|
|
|
|
|
### Examples
|
|
|
-*Coming Soon*
|
|
|
+#### Sending email using Gmail
|
|
|
+```
|
|
|
+e := NewEmail()
|
|
|
+ e.From = "Jordan Wright <test@gmail.com>"
|
|
|
+ e.To = []string{"test@example.com"}
|
|
|
+ e.Bcc = []string{"test_bcc@example.com"}
|
|
|
+ e.Cc = []string{"test_cc@example.com"}
|
|
|
+ e.Subject = "Awesome Subject"
|
|
|
+ e.Text = "Text Body is, of course, supported!"
|
|
|
+ e.Html = "<h1>Fancy Html is supported, too!</h1>"
|
|
|
+ e.Send("smtp.gmail.com:587", smtp.PlainAuth("", e.From, "password123", "smtp.gmail.com"))
|
|
|
+```
|
|
|
+
|
|
|
+#### Attaching a File
|
|
|
+```
|
|
|
+e := NewEmail()
|
|
|
+e.Attach('test.txt')
|
|
|
+```
|
|
|
|
|
|
### Documentation
|
|
|
[http://godoc.org/github.com/jordan-wright/email](http://godoc.org/github.com/jordan-wright/email)
|