Categorygithub.com/harkaitz/go-msmtp
modulepackage
1.0.1
Repository: https://github.com/harkaitz/go-msmtp.git
Documentation: pkg.go.dev

# README

GO MSMTP

Small library for sending mails using msmtp(1) and file(1) in Go.

Go documentation

package msmtp // import "github.com/harkaitz/go-msmtp"

var Verbose bool = false
func Mime(file string) (mime string, err error)
func Send(to string, m Message) (err error)
type Attachment struct{ ... }
type Message struct{ ... }

Go type Message

package msmtp // import "."

type Message struct {
    FromAccount string       // Optional, otherwise default account is used.
    Subject     string       // Optional.
    Body        string       // Optional, by default an empty string.
    UseHTML     bool         // Optional, by default false.
    Attachments []Attachment // Optional.
}
    Message is a struct that contains the information needed to send an email
    using MSMTP.

Go type Attachment

package msmtp // import "."

type Attachment struct {
    Name string // Required, some file name.
    Mime string // Required, you can calculate it with Mime().
    Data []byte // Optional
}
    Attachment is a struct that contains the information needed to attach a file
    to an email.

Collaborating

For making bug reports, feature requests and donations visit one of the following links:

  1. gemini://harkadev.com/oss/
  2. https://harkadev.com/oss/

# Packages

No description provided by the author

# Functions

Mime returns the MIME type of a file using file(1).
Send sends an email using MSMTP.

# Variables

Verbose is a global variable that can be set to true to enable verbose mode.

# Structs

Attachment is a struct that contains the information needed to attach a file to an email.
Message is a struct that contains the information needed to send an email using MSMTP.