
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
github.com/jordan-wright/email
Robust and flexible email library for Go
The email
package is designed to be simple to use, but flexible enough so as not to be restrictive. The goal is to provide an email interface for humans.
The email
package currently supports the following:
go get github.com/jordan-wright/email
Note: Version > 1 of this library requires Go v1.5 or above.
If you need compatibility with previous Go versions, you can use the previous package at gopkg.in/jordan-wright/email.v1
e := email.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 = []byte("Text Body is, of course, supported!")
e.HTML = []byte("<h1>Fancy HTML is supported, too!</h1>")
e.Send("smtp.gmail.com:587", smtp.PlainAuth("", "test@gmail.com", "password123", "smtp.gmail.com"))
You can also create an email directly by creating a struct as follows:
e := &email.Email {
To: []string{"test@example.com"},
From: "Jordan Wright <test@gmail.com>",
Subject: "Awesome Subject",
Text: []byte("Text Body is, of course, supported!"),
HTML: []byte("<h1>Fancy HTML is supported, too!</h1>"),
Headers: textproto.MIMEHeader{},
}
You can also create an email from any type that implements the io.Reader
interface by using email.NewEmailFromReader
.
e := NewEmail()
e.AttachFile("test.txt")
(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)
}
}()
}
http://godoc.org/github.com/jordan-wright/email
Sections inspired by the handy gophermail project.
I'd like to thank all the contributors and maintainers of this package.
A special thanks goes out to Jed Denlea jeddenlea for his numerous contributions and optimizations.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.