gosendmail

command module
v0.0.0-...-f3607b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 11 Imported by: 0

README

gosendmail

A tiny sendmail replacement for environments with smarthosts, based on mhsendmail

> go get github.com/squash/gosendmail

> gosendmail test@mailhog.local <<EOF
From: App <app@mlocal>
To: Test <test@mlocal>
Subject: Test message

Some content!
EOF

gosendmail looks for default options in /etc/gosendmail.toml. An example is provided.

You can override the from address (for SMTP MAIL FROM):

gosendmail --from="admin@mailhog.local" test@mailhog.local ...

Or pass in multiple recipients:

gosendmail --from="admin@ocal" test@mailhog.local test2@mailhog.local ...

Or override the destination SMTP server:

gosendmail --smtp-addr="localhost:1026" test@local ...

To use from php.ini

sendmail_path = "/usr/local/bin/gosendmail"
For use in containers

Some container bases will require you to use a statically linked binary, which you can build with:

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w -extldflags "-static"'
Licence

Original Copyright ©‎ 2015 - 2016, Ian Kent (http://iankent.uk) (c) 2020 Josh Grebe (https://github.com/squash/)

Released under MIT license, see LICENSE for details.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL