-
Notifications
You must be signed in to change notification settings - Fork 230
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
async await syntax doesn't work #267
Comments
the current version of the library is (mostly) written in the old "errback" style, so for now the recommendation is to use i'm not opposed to switching to a |
code snippet for const client = new SMTPClient({});
// bind necessary to retain internal access to client prototype
const sendAsync = util.promisify(client.send.bind(client));
try {
const result = await sendAsync(message);
} catch (err) {
// handle err
} |
thanks @zackschuster lgtm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just a heads up that this doesn't send email successfully when using async/await syntax. The code runs through as if it succeeded (doesn't throw an error), but the email is not sent and
result
logs asundefined
.The callback style in the docs works, of course.
But it might be good to support both.
The text was updated successfully, but these errors were encountered: