Skip to content

quixote-liu/email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example

    import (
        "net/smtp"
        "github.com/quixote-liu/email"
    )

    func main() {
        e := email.Email{
            From:     "[email protected]",
            To:       []string{"[email protected]"},
            Subject:  "This is Subject",
            Addr:     "smtp.example.com:25",
        }

        if err := e.AttachFile("./filename.txt"); err != nil {
        	log.Fatal(err)
        }

        auth := smtp.PlainAuth("", "[email protected]", "your_password", "smtp.example.com")
        message := []byte("hello, world")

        err := e.SetAuth(auth).WriteText(message).Send()
        if err != nil {
            log.Fatal(err)
        }

        // reset email message, include attchments.
        e.Reset()
    }

About

email client tool

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages