I am trying to send email using sendGrid (In my mobile application). So i wrote a cloud function and deployed it into firebase.(using this,Visit https://angularfirebase.com/lessons/angular4-transactional-email-with-cloud-functions-and-sendgrid/).
it was uploaded to firebase. But, when i try to send post request(Using postman{"to":"user1@gmail.com","from":"duser253@gmail.com","subject":"test-email","content":"content"}
), in firebase log shows some errors
SendGridError: Response error
at /user_code/node_modules/sendgrid/lib/sendgrid.js:104:23
at ClientRequest.<anonymous> (/user_code/node_modules/sendgrid/node_modules/sendgrid-rest/lib/client.js:124:7)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.socketErrorListener (_http_client.js:310:9)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at connectErrorNT (net.js:1040:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
message: 'Response error',
response:
{ statusCode: 500,
body:
{ message: 'getaddrinfo ENOTFOUND api.sendgrid.com api.sendgrid.com:443',
name: 'Error',
stack: 'Error: getaddrinfo ENOTFOUND api.sendgrid.com api.sendgrid.com:443
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)' },
headers: {} }
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…