That said, when I tried this, Yandex’ SMTP server rejected the invitations sent by n8n:
2022-05-25T09:03:12.051Z | error | Failed to send email {"recipients":"[email protected]","error":{"code":"EMESSAGE","response":"554 5.7.1 Message rejected under suspicion of SPAM; https://ya.cc/1IrBc 1653469390-HJ9Eb4DLIS-3AKC8sjP","responseCode":554,"command":"DATA"},"file":"NodeMailer.js","function":"sendMail"}
This response “Message rejected under suspicion of SPAM” is coming from Yandex and I don’t think this problem could be addressed from n8n’s end unfortunately. Yandex simply doesn’t seem to like automated messages
Perhaps their support can further assist you and whitelist such messages. There is also a chance they might not identify your messages as spam if you use your mailbox more regularly than I do once you have configured the SMTP settings I have shared above.
If you want to try it, you might want to set the N8N_LOG_LEVEL=debugenvironment variable to get the maximum possible logging output on your server.
This is strange but I have same error with my own exim server
I can telnet to 25 port from machine and from docker container to server but have this error | Failed to send email {"recipients":"[email protected]","error":{"errno":-3008,"code":"EDNS","syscall":"getaddrinfo","hostname":"\"exim_ip\"","command":"CONN"},"file":"NodeMailer.js","function":"sendMail"}
Hey @Konstantin , I have not seen this particular error coming from NodeMailer, but I could find this information:
(…) Unfortunately, the error code -3008 is represented as “Unknown error”. My guess is that the error code comes from somewhere else than the getaddrinfo function, perhaps some underlying system call (…)
So unfortunately I can’t quite tell what’s wrong here. Just out of curiosity, could you test this using an email provider like Sendgrid? That was the provider I have used for n8n user management and it worked fine using a configuration like this:
I am having a similar problem. I can telnet and manually from my lxc container authenticate to my mail server and send an email. I can even create a node to send an email. However I can’t get my self hosted n8n to send an invitation email or forgot my password email.
I have environment variables set at in my /profile
export N8N_EMAIL_MODE=smtp
export N8N_SMTP_HOST=mail.mydomain.com
export N8N_SMTP_PASS=myvalidpasword
export [email protected]
export N8N_SMTP_USER=validuser
export N8N_SMTP_SSL=false
Any ideas?
You could check the console output of your n8n instance (or alternatively check the log file if you write your instance logs into a file), but it might not have a helpful error unfortunately. It’d still be good to check.
Some things that come to my mind:
Where you also using port 465 when testing your email server through other means? I know many ISPs block this port.
Could you double check n8n is able to read your variables? I assume when you were sending emails through a regular n8n node you were using the same settings. So I am wondering if this could be a problem with n8n not being able to access your environment variables. You can for example verify this by running a workflow like the one below (make sure to actually execute it, the variable would not show up in the UI preview):
Lastly, could you confirm which email provider you are using? Just so I can test this provider on my end.
Using the workflow you provided I was able to figure it out. We are using PM2 and the environment variables were not being passed to the PM2 environment where N8N was running. Thanks for your help.