A tiny sendmail replacement for environments with smarthosts, based on mhsendmail
> go get github.com/squash/gosendmail
> gosendmail [email protected] <<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="[email protected]" [email protected] ...
Or pass in multiple recipients:
gosendmail --from="admin@ocal" [email protected] [email protected] ...
Or override the destination SMTP server:
gosendmail --smtp-addr="localhost:1026" test@local ...
To use from php.ini
sendmail_path = "/usr/local/bin/gosendmail"
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"'
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.