Skip to content

Commit df65596

Browse files
authored
Improve docs regarding mail debugging (#555)
1 parent 6f2cd8a commit df65596

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

docs/installation/environment-variables.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,17 @@ Slack
137137
Configure the following environment variable to enable MicroPowerManager to send email via SMTP.
138138
These configure instance level email sent to tenants, for example signup confirmation, password reset, etc...
139139

140-
| Environment Variable | Default | Description |
141-
| --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
142-
| `MAIL_SMTP_HOST` | `smtp.mailgun.org` | Mail server hostname. For example `smtp.mailserver.com`. |
143-
| `MAIL_SMTP_PORT` | `587` | Mail server port. |
144-
| `MAIL_SMTP_ENCRYPTION` | `tls` | Mail encryption. |
145-
| `MAIL_SMTP_AUTH` | `false` | Whether to use SMTP Auth. |
146-
| `MAIL_USERNAME` | **Required** (when `MAIL_SMTP_AUTH` is `true`) | The username used in SMTP Auth. |
147-
| `MAIL_PASSWORD` | **Required** (when `MAIL_SMTP_AUTH` is `true`) | The password used in SMTP Auth. |
148-
| `MAIL_SMTP_DEFAULT_SENDER` | **Required** | The email used in `from` and `replyTo` fields of sent email. Note: Depending on the mailserver this might be different from SMTP Auth username. |
149-
| `MAIL_SMTP_DEFAULT_MESSAGE` | `Please do not reply to this email` | Default message body of emails. |
150-
| `MAIL_SMTP_DEBUG_LEVEL` | `0` | Debug level used in [PHPMailer](https://github.com/PHPMailer/PHPMailer/). `0` No output, `4` Noisy, low-level data output, rarely needed. |
140+
| Environment Variable | Default | Description |
141+
| --------------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
142+
| `MAIL_SMTP_HOST` | `smtp.mailgun.org` | Mail server hostname. For example `smtp.mailserver.com`. |
143+
| `MAIL_SMTP_PORT` | `587` | Mail server port. |
144+
| `MAIL_SMTP_ENCRYPTION` | `tls` | Mail encryption. |
145+
| `MAIL_SMTP_AUTH` | `false` | Whether to use SMTP Auth. |
146+
| `MAIL_USERNAME` | **Required** (when `MAIL_SMTP_AUTH` is `true`) | The username used in SMTP Auth. |
147+
| `MAIL_PASSWORD` | **Required** (when `MAIL_SMTP_AUTH` is `true`) | The password used in SMTP Auth. |
148+
| `MAIL_SMTP_DEFAULT_SENDER` | **Required** | The email used in `from` and `replyTo` fields of sent email. Note: Depending on the mailserver this might be different from SMTP Auth username. |
149+
| `MAIL_SMTP_DEFAULT_MESSAGE` | `Please do not reply to this email` | Default message body of emails. |
150+
| `MAIL_SMTP_DEBUG_LEVEL` | `0` | Debug level used in [PHPMailer](https://github.com/PHPMailer/PHPMailer/blob/master/src/SMTP.php#L116-L126). `0` No output, `4` Noisy, low-level data output, rarely needed. |
151151

152152
### MPM Plugins
153153

src/backend/app/Helpers/MailHelper.php

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ private function configure(): void {
3030
$this->mailer->Password = $this->mailSettings['password'];
3131
$this->mailer->From = $this->mailSettings['default_sender'];
3232
$this->mailer->SMTPDebug = $this->mailSettings['debug_level'];
33+
// https://github.com/EnAccess/micropowermanager/issues/554
3334
$this->mailer->Debugoutput = 'error_log';
3435
$this->mailer->isSMTP();
3536
// When debugging Email sending locally it might helpful to explicitly set a Hostname

0 commit comments

Comments
 (0)