-
Notifications
You must be signed in to change notification settings - Fork 72
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
forceSend fails, tries to connect to 587 #474
Comments
Hm that is an unexpected error. It looks like it's trying to connect to localhost port 587 rather than your mailgun url to send the email. This fails of course because you are not running anything on 587, mailgun is. Are you sure your env variables are set correctly for the preview server and you've tried restarting the preview server? My best guess is that the env variable is not getting set somehow. Try logging Otherwise there must be a bug with how mailing is ingesting your env variables. |
@psugihara Happy to try logging the EMAIL_HOST but did you see the above? Without changing any env vars, etc., if I simply add that param to the same code that was triggering the preview, the email sends perfectly... so it seems like the post-intercept sending code isn't picking up the env vars. E.g.:
Make sense? Thanks ! |
The thing I was trying to tease out is whether the env variable is set in your app process but not the preview server process. If the env var is not being picked up, I'd recommend blowing away .mailing and restarting the preview server fresh. But if both cases (steps 2 and 4) of trying to send are via the button then that absolutely sounds like a bug because the button sends via the mailing preview server. |
No, step 4 is from within the app, with that flag set to skip the preview. Sending from the FORCE_SEND option doesn't ever work in preview. Logging Note: My .env is defined in .env.local, not .env. Is that at play? |
Okay, further wonkiness.
^^ in my app's API libraries. However, as soon as I start the mailing server, I get the following error:
And the FORCE SEND option still gives:
|
Yes, the preview server calls dotenv.register() which just looks at .env. It works when you send from your app because you’re reading in .env.local into your process.env somehow. To confirm, try moving .env.local contents to .env
|
Great, progress.
Maybe adding a param for a custom .env path in the mailing config would help? You can inject that into the dotenv command at startup as such: or maybe even use it to add on top of the default .env if someone want to make a .env.mailing or something...
|
Good find. I didn't know next was using
Seem good? |
GEFN! And while we're in this conversation, thanks for both your excellent
software and your helpfulness.
|
Describe the bug
In development, when trying to use the FORCE_SEND feature within the email preview, it fails with a 500 error on the /api/sendMail request.
I suspect this has to do with my recently implementing a mail server on port 587, but your /api/sendMail API is listening on either an http/https or standard SMTP port 25.
I don't believe it's my transport config because when I manually insert
dangerouslyForceDeliver: true
into my buildSendMail config, it sends the email correctly.Server logs:
To Reproduce
Steps to reproduce the behavior:
Configure a transport using port 587 as such:
Expected behavior
I expect it to send using my normal transport setings.
Screenshots
The text was updated successfully, but these errors were encountered: