[Support Request]: can't send email from bookstack using mailgun #2533

Closed
opened 2026-02-05 04:25:44 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @protriden on GitHub (Dec 18, 2021).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I have made the changes to .env file with matching email credentials

# Mail system to use
# Can be 'smtp' or 'sendmail'
MAIL_DRIVER=smtp

# Mail sender details
MAIL_FROM_NAME="domain"
MAIL_FROM=info@domain.com

# SMTP mail options
# These settings can be checked using the "Send a Test Email"
# feature found in the "Settings > Maintenance" area of the system.
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=465
MAIL_USERNAME=postmaster@domain.com
MAIL_PASSWORD=**********************************************************
MAIL_ENCRYPTION=tls

but still if i try to test the mail function from maintenance section i am getting this below error
Error thrown when sending a test email: Expected response code 220 but got an empty response

But the configs are 100% correct.

Exact BookStack Version

BookStack v21.11.2

Log Content

No response

PHP Version

7.4

Hosting Environment

ubuntu 20.04 vps installed bookstack using scripts

Originally created by @protriden on GitHub (Dec 18, 2021). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario I have made the changes to .env file with matching email credentials ``` # Mail system to use # Can be 'smtp' or 'sendmail' MAIL_DRIVER=smtp # Mail sender details MAIL_FROM_NAME="domain" MAIL_FROM=info@domain.com # SMTP mail options # These settings can be checked using the "Send a Test Email" # feature found in the "Settings > Maintenance" area of the system. MAIL_HOST=smtp.mailgun.org MAIL_PORT=465 MAIL_USERNAME=postmaster@domain.com MAIL_PASSWORD=********************************************************** MAIL_ENCRYPTION=tls ``` but still if i try to test the mail function from maintenance section i am getting this below error `Error thrown when sending a test email: Expected response code 220 but got an empty response` But the configs are 100% correct. ### Exact BookStack Version BookStack v21.11.2 ### Log Content _No response_ ### PHP Version 7.4 ### Hosting Environment ubuntu 20.04 vps installed bookstack using scripts
OVERLORD added the 🐕 Support label 2026-02-05 04:25:44 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Dec 18, 2021):

Hi @protriden,
Can you try using 587 as the port number instead? Leave all other settings as-is. Let me know if there's any difference in error.

@ssddanbrown commented on GitHub (Dec 18, 2021): Hi @protriden, Can you try using 587 as the port number instead? Leave all other settings as-is. Let me know if there's any difference in error.
Author
Owner

@protriden commented on GitHub (Dec 18, 2021):

Thank you @ssddanbrown now it's working good. I also needed to run sudo ufw allow 587/tcp this command to allow port number on ubuntu.

Thanks for the support.

@protriden commented on GitHub (Dec 18, 2021): Thank you @ssddanbrown now it's working good. I also needed to run `sudo ufw allow 587/tcp` this command to allow port number on ubuntu. Thanks for the support.
Author
Owner

@ssddanbrown commented on GitHub (Dec 18, 2021):

I also needed to run sudo ufw allow 587/tcp this command to allow port number on ubuntu.

I'm surprised by that. Usually outgoing ports are not blocked by default but may depend on specific system.

Happy to hear it's working though. Will therefore close this off.

@ssddanbrown commented on GitHub (Dec 18, 2021): > I also needed to run sudo ufw allow 587/tcp this command to allow port number on ubuntu. I'm surprised by that. Usually outgoing ports are not blocked by default but may depend on specific system. Happy to hear it's working though. Will therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2533