Back

[SOLVED] I try to run simple function

  • 0
  • Functions
Meldiron
9 Mar, 2023, 11:50

Run this inside your appwrite folder: docker compose exec appwrite vars Are the variables that you set in .env there?

TL;DR
User was having trouble running a simple function. The issue was with the sender name in Sendgrid causing some trouble. It was recommended to configure a domain or use an email address hosted by Sendgrid. The user tried setting the sender name in the .env file but received an SMTP server error. It was suggested to check the Sendgrid logs for any errors and to make sure the necessary variables were set correctly in the .env file. The user tried restarting Appwrite but the email still wasn't being sent. Finally, the user was instructed to run a command to check if the variables set in the .env file were present.
Andrewwww
9 Mar, 2023, 11:51

yes

Andrewwww
9 Mar, 2023, 11:52

no isn't

Meldiron
9 Mar, 2023, 11:52

Cool. Then let's try to restart Appwrite to apply those. Let's run: docker compose down then docker compose up -d

Andrewwww
9 Mar, 2023, 11:53

i try now

Andrewwww
9 Mar, 2023, 11:58

now it's working but the email isn't send

Andrewwww
9 Mar, 2023, 11:58
  • _APP_SMTP_HOST=smtp.sendgrid.net
  • _APP_SMTP_PORT=587
  • _APP_SMTP_SECURE=tls
  • _APP_SMTP_USERNAME=apikey
  • _APP_SMTP_PASSWORD=SG...
Meldiron
9 Mar, 2023, 11:59

Amazing! This could be Sendgrid related. You can check logs here: docker compose logs appwrite-worker-mails. Any errors there? If not, you can check Sendgrid to see if they dismissed email for some reason

Andrewwww
9 Mar, 2023, 11:59

yes

Andrewwww
9 Mar, 2023, 11:59

503

Andrewwww
9 Mar, 2023, 12:00

appwrite-worker-mails | ,503,SMTP server error: MAIL FROM command failed Detail: Only one sender per message, please appwrite-worker-mails | SMTP code: 503 in /usr/src/code/app/workers/mails.php:68 appwrite-worker-mails | Stack trace: appwrite-worker-mails | #0 /usr/src/code/src/Appwrite/Resque/Worker.php(122): MailsV1->run() appwrite-worker-mails | #1 /usr/src/code/vendor/resque/php-resque/lib/Resque/Job.php(201): Appwrite\Resque\Worker->perform() appwrite-worker-mails | #2 /usr/src/code/vendor/resque/php-resque/lib/Resque/Worker.php(303): Resque_Job->perform() appwrite-worker-mails | #3 /usr/src/code/vendor/resque/php-resque/lib/Resque/Worker.php(242): Resque_Worker->perform(Object(Resque_Job)) appwrite-worker-mails | #4 /usr/src/code/vendor/resque/php-resque/bin/resque(185): Resque_Worker->work('1', false) appwrite-worker-mails | #5 {main}

Meldiron
9 Mar, 2023, 12:00

I think we only use one sender 🤔 What is your value in .env for _APP_SYSTEM_EMAIL_NAME and _APP_SYSTEM_EMAIL_ADDRESS?

Andrewwww
9 Mar, 2023, 12:01

need to be same with sendGrid sender?

Meldiron
9 Mar, 2023, 12:01

I would think, yeah. If not, it could cause some spam folder issues

Andrewwww
9 Mar, 2023, 12:01

i try now

Andrewwww
9 Mar, 2023, 12:03
Andrewwww
9 Mar, 2023, 12:03

like this?

Meldiron
9 Mar, 2023, 12:04

I don't think Sendgrid allows gmail sender. Do they? I think you will need to configure a domain, or use email address hosted by Sendgrid

Meldiron
9 Mar, 2023, 12:04

Regarding name, that should be sender name. Like "Matej Baco" or "My App Noreply". maybe the dot is causing some trouble

Andrewwww
9 Mar, 2023, 12:07

it's working

Meldiron
9 Mar, 2023, 12:07

Eyyy 🎉

Andrewwww
9 Mar, 2023, 12:07

thx a lot <:appwritefire:823999000330895380>

Meldiron
9 Mar, 2023, 12:08

Always happy to help! <:appwritepeepo:951504790398074950>

Andrewwww
9 Mar, 2023, 12:08

Have a nice day🙌

Meldiron
9 Mar, 2023, 12:08

[SOLVED] I try to run simple function

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