Thursday, 11 May 2017

Meteor Send email to intranet email

I am Developing a Meteor App to handle requests, the app is finished, but i need to have some emails with a default text sent everytime a request is created or updated.

The problem i run into is, i am on an intranet, and our mail server is using the standart 25 port.

i can ping the mail server and checked if the :25 port is open. the localhost port 25 is on listening state.

I am using the default email package of meteor, that i have used many times before outside our intranet and always worked fine.

my server code is the following:

#in the meteor startup i put the env MAIL_URL
process.env.MAIL_URL = 'smtp://varajao.rjr:password@ipaddress:25';
#in the methots i put the sendMail Func
sendEmail: function(to, from, subject, text) {
  console.log('para: '+ to + 'de: ' + from);
  console.log('assunto ' + subject + 'texto: ' + text);
  check([to, from, subject, text], [String]);
  this.unblock();

  Email.send({to, from, subject, text});

}

and i am getting the following on server, check the fist line and the comment in the end of it.

Exception while invoking method 'sendEmail' Error: getaddrinfo EAI_AGAIN varajao.rjr:587 **----->somehow this is my username with :587 port**
I20170511-13:50:57.171(1)?     at Object.Future.wait (/home/administrador/.meteor/packages/meteor-tool/.1.4.4_2.8rbyl1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:449:15)
I20170511-13:50:57.171(1)?     at Mail._syncSendMail (packages/meteor.js:213:24)
I20170511-13:50:57.172(1)?     at smtpSend (packages/email.js:110:13)
I20170511-13:50:57.172(1)?     at new Email.send (packages/email.js:168:5)
I20170511-13:50:57.173(1)?     at Object.Email.send (packages/meteortoys_email.js:28:25)
I20170511-13:50:57.174(1)?     at [object Object].Meteor.methods.sendEmail (server/main.js:375:13)
I20170511-13:50:57.175(1)?     at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1737:12)
I20170511-13:50:57.175(1)?     at packages/ddp-server/livedata_server.js:719:19
I20170511-13:50:57.176(1)?     at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
I20170511-13:50:57.177(1)?     at packages/ddp-server/livedata_server.js:717:40
I20170511-13:50:57.178(1)?     - - - - -
I20170511-13:50:57.179(1)?   atObject.exports._errnoException(util.js:907:11)
I20170511-13:50:57.179(1)?     at errnoException (dns.js:32:15)
I20170511-13:50:57.180(1)?     at GetAddrInfoReqWrap.onlookup [as oncomplete](dns.js:78:26)

the mail server is inside the intranet, and we can access it directly by out intranet.

Can you guys give me a hand?

thanks is advance

Rob



via RSamurai

No comments:

Post a Comment