email.go 769 B

123456789101112131415161718192021222324252627282930
  1. //Email is designed to be a package providing an "email interface for humans."
  2. //Designed to be robust and flexible, the email package aims to make sending email easy without getting in the way.
  3. package email
  4. import (
  5. "net/mail"
  6. "net/smtp"
  7. )
  8. //Email is the type used for email messages
  9. type Email struct {
  10. From string
  11. To []string
  12. Bcc []string
  13. Cc []string
  14. Subject []string
  15. Text []byte //Plaintext message (optional)
  16. Html []byte //Html message (optional)
  17. Headers []mail.Header
  18. Attachments []Attachment //Might be a map soon - stay tuned.
  19. }
  20. //Send an email using the given host and SMTP auth (optional)
  21. func (e Email) Send(addr string, a Auth, e Email) {
  22. }
  23. type Attachment struct {
  24. Filename string
  25. }