You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.2 KiB

  1. # Gomail
  2. [![Build Status](https://travis-ci.org/go-gomail/gomail.svg?branch=v2)](https://travis-ci.org/go-gomail/gomail) [![Code Coverage](http://gocover.io/_badge/gopkg.in/gomail.v2)](http://gocover.io/gopkg.in/gomail.v2) [![Documentation](https://godoc.org/gopkg.in/gomail.v2?status.svg)](https://godoc.org/gopkg.in/gomail.v2)
  3. ## Introduction
  4. Gomail is a simple and efficient package to send emails. It is well tested and
  5. documented.
  6. Gomail can only send emails using an SMTP server. But the API is flexible and it
  7. is easy to implement other methods for sending emails using a local Postfix, an
  8. API, etc.
  9. It is versioned using [gopkg.in](https://gopkg.in) so I promise
  10. there will never be backward incompatible changes within each version.
  11. It requires Go 1.2 or newer. With Go 1.5, no external dependencies are used.
  12. ## Features
  13. Gomail supports:
  14. - Attachments
  15. - Embedded images
  16. - HTML and text templates
  17. - Automatic encoding of special characters
  18. - SSL and TLS
  19. - Sending multiple emails with the same SMTP connection
  20. ## Documentation
  21. https://godoc.org/gopkg.in/gomail.v2
  22. ## Download
  23. go get gopkg.in/gomail.v2
  24. ## Examples
  25. See the [examples in the documentation](https://godoc.org/gopkg.in/gomail.v2#example-package).
  26. ## FAQ
  27. ### x509: certificate signed by unknown authority
  28. If you get this error it means the certificate used by the SMTP server is not
  29. considered valid by the client running Gomail. As a quick workaround you can
  30. bypass the verification of the server's certificate chain and host name by using
  31. `SetTLSConfig`:
  32. package main
  33. import (
  34. "crypto/tls"
  35. "gopkg.in/gomail.v2"
  36. )
  37. func main() {
  38. d := gomail.NewDialer("smtp.example.com", 587, "user", "123456")
  39. d.TLSConfig = &tls.Config{InsecureSkipVerify: true}
  40. // Send emails using d.
  41. }
  42. Note, however, that this is insecure and should not be used in production.
  43. ## Contribute
  44. Contributions are more than welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for
  45. more info.
  46. ## Change log
  47. See [CHANGELOG.md](CHANGELOG.md).
  48. ## License
  49. [MIT](LICENSE)
  50. ## Contact
  51. You can ask questions on the [Gomail
  52. thread](https://groups.google.com/d/topic/golang-nuts/jMxZHzvvEVg/discussion)
  53. in the Go mailing-list.