Skip to content

txthinking/mailx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mailx

Go Report Card GoDoc

A lightweight SMTP mail library

❤️ A project by txthinking.com

Install

$ go get github.com/txthinking/mailx

Example

server := &mailx.SMTP{
    Server:   "smtp.mailtrap.io",
    Port:     465,
    UserName: "e3f534cfe656f4",
    Password: "b6e38ddc0f1e9d",
}

message := &mailx.Message{
    From: &mail.Address{
        Name:    "mailx",
        Address: "739f35c64d-48cf45@inbox.mailtrap.io",
    },
    To: []*mail.Address{
        {
            Name:    "Cloud",
            Address: "cloud@txthinking.com",
        },
    },
    Subject: "Hello",
    Body:    "I <b>love</b> U.",
    Attachment: []string{
        "/etc/hosts",
    },
}

if err := server.Send(message); err != nil {
    log.Fatal(err)
}

License

Licensed under The MIT License

About

A lightweight SMTP mail library

Topics

Resources

License

Stars

30 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages