i am facing with some strange (for me) behavior.
I am trying to create feedback form in my firebase app
Its a simple form which should send me a email when user submit it.
I created onCall
function in my firebase app.
When i test it locally through firebase experimental:functions:shell
its working and i receive a email, but deployed one always fails with:
{
code: "ECONNECTION"
command: "CONN"
errno: "ENOTFOUND"
}
the body of function:
function feedbacks(data)
{
let email = createEmail(data);
let transport = nodemailer.createTransport({
host: 'smtp.yandex.ru',
port: 465,
secure: true,
// tried this one, but without success too
//tls:{ secureProtocol: "TLSv1_method" },
auth: {
user: 'xxxx@xxxx',
pass: 'xxxx'
}
});
return new Promise((resolve, reject) => {
transport.sendMail(email, err => {
if (err == null) {
resolve(true);
} else {
reject(new functions.https.HttpsError('internal', 'failed', err))
}
});
});
}
It seems that deployed function just can not access smtp server due to some firebase restrictions i don't know.
EDIT:
i tested deployed function with gmail smtp and my gmail credentials which i use in firebase too and it works.
The docs says, that i CAN use custom smtp while its port not 25.
If someone can shed light on that i would appreciate it.