Back

Unable to get SMTP Servers to send mail?

  • 0
  • Self Hosted
ZachHandley
2 Nov, 2023, 00:46

I've setup the .env and the project SMTP (why are they separate? Shouldn't each project in theory have its own SMTP settings so it gets sent through there? What does the .env one do now?) but I cannot get any mail to actually send when I invite people. Additionally, the "Resend Invite" button is still broken, it should in theory (or expected) just resend invite to the organization member, but it p much always says AppwriteException they already have one pending, which is IMO the point of the button but I digress, I can't seem to get SMTP to work. On my other server, I was using Gmail's SMTP servers, and it didn't work either.

TL;DR
Issue: Unable to get SMTP servers to send mail. Cannot get any mail to actually send when inviting people. Resend Invite button is also broken. Solution: 1. Verify credentials for SMTP server. 2. Check logs for any error messages. 3. Ensure that the .env file is properly configured with SMTP settings. 4. Fill out the .env file and override settings per project. 5. Check the docker logs for the appwrite-worker-mails container. 6. Consider filling out the .env file with the actual domain that Appwrite is on. 7. Separate the .env file (Appwrite settings) from project-specific SMTP
Drake
2 Nov, 2023, 00:48

The .env one is the Appwrite one and a fallback for projects. In the project, you can configure project specific settings.

Check the docker logs for the appwrite-worker-mails container

ZachHandley
2 Nov, 2023, 00:48

Gotcha, any reason why that error pops up then?

ZachHandley
2 Nov, 2023, 00:48

The error, more specifically, is when you try to set custom SMTP settings in a project and it says SMTP must be enabled! something like that so you have to fill out the .env file

Drake
2 Nov, 2023, 00:49

The exception on resend is probably a bug

ZachHandley
2 Nov, 2023, 00:49

Gotcha, I'm pretty good with PHP, I can put in a pull request?

Drake
2 Nov, 2023, 00:49

Yes, you should fill out the .env file. Then, you can override per project

ZachHandley
2 Nov, 2023, 00:49

So what do you normally recommend for the base settings? The actual domain itself that Appwrite is on probably?

Drake
2 Nov, 2023, 00:51

Ya. It's used for the appwrite platform itself. Like password recovery for your console account, inviting a user to your org, etc

Drake
2 Nov, 2023, 00:51

Someone has already asked to work on https://github.com/appwrite/appwrite/issues/6251

ZachHandley
2 Nov, 2023, 00:53

Gotcha, thank you, I'll check logs rn

ZachHandley
2 Nov, 2023, 00:55

Yeah it says Could Not Authenticate but it's the exact same credentials as on the server

ZachHandley
2 Nov, 2023, 00:55

Sendmail I believe, we verified credentials last time we were on call yesterday

Drake
2 Nov, 2023, 01:04

So it's an error when configuring the project smtp or the .env file?

ZachHandley
2 Nov, 2023, 01:38

.env file

Drake
2 Nov, 2023, 01:38

Actually I don't see anyone who asked to work on this ...do you want to work on it?

ideclon
2 Nov, 2023, 02:04

This is the same with resending programmatically, I would expect?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more