Closed danieldanielecki closed 1 year ago
@danieldanielecki Phew yeah sounds like a config issue related to your server/domain. Unfortunately I'm not an expert on this field since I'm mainly doing frontend. Maybe someone else can help here or has a similar issue.
@dword-design, is it possible to include auth
object for non-gmail SMTP?
@danieldanielecki I guess it should be possible. The smtp
object is passed to node-mailer
as-is.
Got it working, thanks to adding auth
for non-Gmail SMTP based on my (very) old project (https://github.com/Ditectrev/ditectrev.com-v3/blob/master/server/main.ts#L214-L225) where I used nodemailer
itself.
Additionally, my domain provider was wrong, and indeed I had to use h6.idhosting.pl
lol!
My final solution, works on localhost
and in prod!! Hopefully will save some time to others :)
[
'nuxt-mail',
{
message: {
to: 'contact@doyban.com',
},
smtp: {
host: process.env.MAIL_HOST,
port: process.env.MAIL_PORT,
auth: {
user: process.env.MAIL_ACCOUNT,
pass: process.env.MAIL_PASSWORD,
},
},
},
],
process.env
values are of course coming from environmental variables in .env
.
Hey, I'm trying to have it working in
Nuxt3
app, but even after browsing through the issues, I can't find a workable solution.That's what I can see on production (deployed on
Firebase
, URL: https://doyban.com/contact):It's deployed with
nuxi build
and using Firebase Functions, tried this even withnuxi generate
, then the error was404
. Yes, I know the docs mentionsDoes not work for static sites (via nuxt generate) because the module creates a server route.
, but I wanted to debug further.On localhost:
Note: I checked with the domain provider where mail is hosted about using
h6.idhosting.pl
, and they recommended to usemail.doyban.com
. I got the confirmation of port587
being the correct as well.Here's with
h6.idhosting.pl
deployed, the same effect:Here's with
h6.idhosting.pl
onlocalhost
,500 Can't send mail - all recipients were rejected: 554 5.7.1 <dhcp-077-248-184-129.chello.nl[77.248.184.129]>: Client host rejected: Access denied
this time.The repo is publicly available: https://github.com/Doyban/Doyban-Website, I'd appreciate help, as it must be something really trivial.
I also tried it with
gmail
and it returns200
onlocalhost
:and it was delivered:
Deployed with
gmail
and it returns200
on production:and it was delivered: