From 58f3e7ebf93633f9110de6e51c9076bc49109b6a Mon Sep 17 00:00:00 2001 From: Tim de Pater Date: Sun, 27 Aug 2023 12:02:41 +0200 Subject: [PATCH] Describe how to add e-mail support --- README.md | 3 ++- docs/sending-emails.md | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 docs/sending-emails.md diff --git a/README.md b/README.md index 41ad023..08e1339 100644 --- a/README.md +++ b/README.md @@ -62,4 +62,5 @@ To modify this container to your specific needs please see the following example * [Adding xdebug support](docs/xdebug-support.md) * [Adding composer](docs/composer-support.md) -* [Getting the real IP of the client behind a load balancer](docs/real-ip-behind-loadbalancer.md) \ No newline at end of file +* [Getting the real IP of the client behind a load balancer](docs/real-ip-behind-loadbalancer.md) +* [Sending e-mails](docs/sending-emails.md) \ No newline at end of file diff --git a/docs/sending-emails.md b/docs/sending-emails.md new file mode 100644 index 0000000..6f46c3e --- /dev/null +++ b/docs/sending-emails.md @@ -0,0 +1,16 @@ +# Sending e-mails +To be able to use the `mail()` function in PHP you need to install a MTA (Mail Transfer Agent) in the container. + +The most simple approach is to install `ssmtp`. + +The `ssmtp.conf` file needs to be created based on the [documentation online](https://wiki.archlinux.org/title/SSMTP). + +```Dockerfile +FROM trafex/php-nginx:latest + +# Install ssmtp +RUN apk add --no-cache ssmtp + +# Add configuration +COPY ssmtp.conf /etc/ssmtp/ssmtp.conf +``` \ No newline at end of file