Skip to content
/ gmail Public

gmail library, send emails using your gmail credentials. `gmail app password`

License

Notifications You must be signed in to change notification settings

t4ke0/gmail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gmail

library for sending email using gmail credentials.

Usage

package main

import (
    ...
    
    "github.com/t4ke0/gmail"
    ...
)

func main() {

    username := os.Getenv("GMAIL_USERNAME")
    password := os.Getenv("GMAIL_PASSWORD")

    em := gmail.NewEmail(username, password, gmail.EmailConfig{
        From:        username,
        To:          []string{""}, // put your recipients here
        Subject:     "", // subject here
        MessageText: "", // text body message
        Attachements: []string{}, // files attachments here.
    })

    if err := em.Marshal().Send().Error(); err != nil {
        log.Fatal(err)
    }
}

About

gmail library, send emails using your gmail credentials. `gmail app password`

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages