Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP and Mailgun #11029

Closed
2 tasks done
nedram1 opened this issue May 6, 2022 · 5 comments
Closed
2 tasks done

SMTP and Mailgun #11029

nedram1 opened this issue May 6, 2022 · 5 comments

Comments

@nedram1
Copy link

nedram1 commented May 6, 2022

Debug mode

Describe the bug

I did a quick search of recent issues about this, but didn't see anything. So apologies if this post ends up redundant.

I'm trying to setup SMTP using my Mailgun account.

Below is my Outbound email config with un/pw and email domain removed.

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=myusername
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDR=[email protected]
MAIL_FROM_NAME=Assets
MAIL_REPLYTO_ADDR=[email protected]
MAIL_REPLYTO_NAME=Assets
MAIL_AUTO_EMBED_METHOD='attachment'

I have DNS and whatnot already setup with Mailgun and have other devices sending out emails with no issues.

When I try to send a test email I get the error "Mail could not be sent No additional error message provided. Check your mail settings and app log"

I checked app/storage/logs/larcel.txt and don't have any entries related to SMTP.

Reproduction steps

1.Log into SnipeIT
2.Settings
3.General Settings
4.Click Send Test Mail
...

Expected behavior

Mail to be sent. :)

Screenshots

image

Snipe-IT Version

v5.1.5 build 6055

Operating System

Windows Server 2012 R2

Web Server

IIS

PHP Version

7.4.13

Operating System

Windows

Browser

Firefox

Version

100

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

@welcome
Copy link

welcome bot commented May 6, 2022

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@snipe
Copy link
Owner

snipe commented May 6, 2022

IIRC - if you're using mailgun, you have to do things differently...

Add the following to your .env, and change the MAIL_DRIVER from smtp to mailgun

MAILGUN_DOMAIN='yourdomain'
MAILGUN_SECRET='yoursecret'

@nedram1
Copy link
Author

nedram1 commented May 6, 2022

Thanks. That info helped me solve my issue!

@nedram1 nedram1 closed this as completed May 6, 2022
@snipe
Copy link
Owner

snipe commented May 6, 2022

Great! (We should really document that better in our own docs but it doesn’t come up much.)

@jakenology
Copy link

jakenology commented Jun 12, 2022

I also had this issue, it would be beneficial to add it to the docs I think. I also had SSL instead of TLS so I changed that quick, but after creating an API key (the secret), and adding those two lines to my file, it worked! Thank you guys!!! Also running on PHP 8 on Ubuntu in AWS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants