
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
github.com/mdigger/gmail
Library to send messages using Google GMail.
You need to register the app on the Google server and get the configuration file that will be used for authorization. When you first initialize the application in the console will display the URL you need to go and get the authorization code. This code must be entered in response to the application and execution will continue. This function must be performed once the authorization keys stored in files.
package main
import (
"io/ioutil"
"log"
"github.com/mdigger/gmail"
)
func main() {
// initialize the library
if err := gmail.Init("config.json", "token.json"); err != nil {
log.Fatal(err)
}
// create a new message
msg, err := gmail.NewMessage(
"Subject", // subject
"me", // from
[]string{"Test User <test@example.com>"}, // to
nil, // cc
[]byte(`<html><p>body text</p></html>`), // message body
)
if err != nil {
log.Fatal(err)
}
// attach file
if err = msg.AddFile("README.md"); err != nil {
log.Fatal(err)
}
// send a message
if err := msg.Send(); err != nil {
log.Fatal(err)
}
}
### Registration procedure
client_secret.json
.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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.