Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accounts.forgotPassword/Email error: "forgotPassword" Error: Greeting never received

Tags:

meteor

So I'm not using the generic Accounts-ui package and am configuring a password recovery system. So far, so good...until the error below showed up:

enter image description here

I know it's an error with my smtp setup in /sever/smtp.js, which reads like this:

Meteor.startup(function () {
  smtp = {
    username: 'myEmail%40gmail.com',
    password: 'password',
    server:   'smtp.gmail.com',
    port: 25
  }

  process.env.MAIL_URL = 'smtp://myEmail%40gmail.com:' + encodeURIComponent('password') + "@smtp.gmail.com:25";
});

I guess you can completely ignore the smtp object above, since I had to manually change the process.env.MAIL_URL variable because I had another error before this. This entire process is set up on my local computer/localhost.

I had port 465 before this and there was an error where the username and password were not found. I changed to port 25 and the process worked until I got this error saying that the greeting was never received.

Any help with this is much appreciated.

Edit: I would also like to add that adding the email package and changing up the ports messes up the Accounts.createUser function, where Meteor is unable to create a user unless I remove the smtp setup from the server.

like image 939
Mabeh Al-Zuq Yadeek Avatar asked Jan 28 '16 22:01

Mabeh Al-Zuq Yadeek


1 Answers

I am noob in Meteor, but the below did work for me .

Meteor.startup(function () {
  smtp = {
    username: 'myEmail',   // eg: [email protected]
    password: 'password,   // eg: password for your email
    server:   'smtp.gmail.com',  // gmail smtp
    port: 25
  }

  process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' + encodeURIComponent(smtp.password) + '@' + encodeURIComponent(smtp.server) + ':' + smtp.port;
});

Let me know if this worked

like image 68
Azaruddin Sherif Avatar answered Oct 13 '22 08:10

Azaruddin Sherif