Closed nicolasf10 closed 2 weeks ago
Thank you for the report! This is really unfortunate, have you maybe found a way around it?
This is related to #1553 and we are looking to open up the customization of the email sender options.
@infomiho thanks for the reply!
I haven't solved the issue yet, but the error I wrote earlier is gone after adding the SMTP variables (SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD) directly in the fly-server.toml
file. Now the issue seems to be related to the AWS SES credentials: Failed to send email Error: Missing credentials for "PLAIN"Failed to send email Error: Missing credentials for "PLAIN"
I managed to fix the issue! As you can see in the previous message I set the username variable name to SMTP_USER
instead of SMTP_USERNAME
. For some reason I had to declare these variables not only on the .env.server
file, but also directly write them on the fly-server.toml
and it worked!
fly-server.toml
[env]
SMTP_HOST = "email-smtp.[region].amazonaws.com"
SMTP_PORT = "..."
SMTP_USERNAME = "..."
SMTP_PASSWORD = "..."
@nicolasf10 I'd advise against setting the env vars this way. The TOML file is meant to be included in your version control (e.g. Git) so it shouldn't contain secrets like this.
Setting the env vars in .env.server
only works for you in the development, but in production you need to set env vars on the Fly dashboard or via the CLI. Here we wrote about dev/prod differences: https://wasp-lang.dev/docs/project/env-vars
Thank you for the heads up I now managed to set the variables through the Fly dashboard and it's working 🙏
Closing as it will be done as part of #1553 .
Describe the bug I'm having issues setting up SMTP using AWS' SES (Simple Email Service), and after researching the issue I've realized that one potential fix is correctly setting the
secure
field on the configuration for nodemailer's createTransport function.This is how Wasp is currently "initializing smtp email sender". My thought was to add the field
secure
andrequireTLS
and allow the user to set said parameters through the.env.server
like the host, port, username, and password.By the way, the error I get is only occurring after deploying my app to Fly.io (using the CLI). When running my app locally AWS SES doesn't seem to have any problems. This the error from my live logs of my server: