Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional arguments passed to the SMTP object do result in a throw if undefined is passed #225

Closed
SanderDeWaal1992 opened this issue Jul 2, 2018 · 1 comment

Comments

@SanderDeWaal1992
Copy link

SanderDeWaal1992 commented Jul 2, 2018

When I omit for example the 'timeout' option, it works ok. If I set timeout to be undefined, it does throw:

// Does go well:
emailJs.server.connect({
	user: "username",
	password: "password",
	host: "127.0.0.1",
	port: 1234
});
// Does not go well:
// Will throw  `The "msecs" argument must be of type number. Received type undefined`
emailJs.server.connect({
	user: "username",
	password: "password",
	host: "127.0.0.1",
	port: 1234,
	timeout: undefined
});

This problem occurs since version 2.1.0. Version 2.0.0 did work as expected.

Expected behavior

both of above code snippets should work the same way.

@zackschuster
Copy link
Collaborator

@SanderDeWaal1992 this is due to some faulty logic with the Object.assign call in the SMTP constructor. i've put up a PR to fix this.

@eleith eleith closed this as completed in da4c83d Jul 6, 2018
eleith added a commit that referenced this issue Jul 6, 2018
ensure timeout is set to default value (fixes #225)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants