Search code examples
node.jsibm-cloudibm-watson

IBM Cloud - Nodemailer works on CloudFunctions, but gives an error on Watson Conversation


I'm trying to integrate nodemailer and IBM Watson together. The issue is that the function works on the cloud functions, but when I integrate it with IBM Conversation, it gives me this error:

Error Code:

{"code":500,"msg":"Error","reason":{"code":"EENVELOPE","command":"API"}}

This is the config:

let smtpConfig = {
    host: 'smtp.gmail.com',
    port: '587',
    auth: {
        user: '****', 
        pass: '****'
    },
    secureConnection: 'false',
    tls: {
        ciphers: 'SSLv3',
        rejectUnauthorized: false

    }
};
  • I have turned off 'Less secure app access', which still doesn't work.

Any idea what the error code means?


Solution

  • I found the answer. You have to put \\ before the '@' in the parameters for Watson.

    Wrong: "email": "[email protected]"

    Correct: "email": "email\\@gmail.com"