Hello, I am having trouble with Accounts.forgotPassword.
I have done the following:
- I set the process.env.MAIL_URL to “smtp://admin:password@sandboxd1d03e5d396e4db3a0aeff298404ab71.mailgun.org:587”;
- I am calling the forgotten pass function on the client (I think) as follows:
import React from "react";
import {Link} from 'react-router';
import LanguageChanger from '../ui/LanguageChanger';
import {Session} from "meteor/session";
import {withTracker} from "meteor/react-meteor-data";
import PropTypes from 'prop-types';
import {Accounts} from 'meteor/accounts-base';
export class ForgottenPassword extends React.Component{
constructor(props) {
super(props);
this.state = {
error:""
};
}
onSubmit(e) {
e.preventDefault();
let email = this.refs.email.value.trim();
console.log('email', email);
Accounts.forgotPassword({email: email}, function (e, r) {
if (e) {
console.log(e.reason);
} else {
// success
}
});
}
render () {
return (
<div>
<h1> {this.props.staticTexts.forgottenPasswordTexts[0]} </h1>
{this.state.error?<p>{this.state.error}</p> : undefined}
<form onSubmit={this.onSubmit.bind(this)} noValidate>
<input type="email" ref="email" name = "email" placeholder = {this.props.staticTexts.forgottenPasswordTexts[1]} />
<button> {this.props.staticTexts.forgottenPasswordTexts[2]}</button>
</form>
<Link to="/"> {this.props.staticTexts.forgottenPasswordTexts[3]}</Link>
<LanguageChanger/>
</div>
);
}
}
ForgottenPassword.propTypes = {
staticTexts:PropTypes.object.isRequired,
};
export default withTracker( () => {
const staticTexts = Session.get('staticTexts');
return {
staticTexts
};
}) (ForgottenPassword);
And each and every time I run this on my localhost:3000, I get the following output…
I20190117-14:50:06.709(2)? Exception while invoking method 'forgotPassword' { Error: connect ETIMEDOUT 34.205.179.96:587
I20190117-14:50:06.711(2)? at Object._errnoException (util.js:992:11)
I20190117-14:50:06.711(2)? at _exceptionWithHostPort (util.js:1014:20)
I20190117-14:50:06.711(2)? at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
I20190117-14:50:06.712(2)? code: 'ECONNECTION',
I20190117-14:50:06.712(2)? errno: 'ETIMEDOUT',
I20190117-14:50:06.712(2)? syscall: 'connect',
I20190117-14:50:06.713(2)? address: '34.205.179.96',
I20190117-14:50:06.713(2)? port: 587,
I20190117-14:50:06.713(2)? command: 'CONN' }
I tried many things, for example:
- uninstall and reinstall email package with version 1.2.0,
- try to set smtp server
- deploy to heroku and add that domain to mailgun (which is what I am trying to use here)…
and so on…
Can you please help me out, because I am starting to lose my patience and this is not good… (e.g. the computer is in grave danger - and he is innocent as always)… Or is he??
All the best,
Peter Y.