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

tlssock._start is not a function when trying to use nodemailer #3035

Closed
dehrhard opened this issue Dec 21, 2022 · 2 comments
Closed

tlssock._start is not a function when trying to use nodemailer #3035

dehrhard opened this issue Dec 21, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@dehrhard
Copy link

Describe the bug
I'm trying to use nodemailer for an email service. createTransport works but if I try to call transport.sendMail. I receive the Error: Error initiating TLS - tlssock._start is not a function.
It looks like it happens in nodemailer when it tries to upgrade the connection in _upgradeConnection. In there it is calling tls.connect where tls is the native node module.
So it looks like the _start function is not polyfilled

Steps to Reproduce

  1. Create Transport
import { createTransport } from 'npm:nodemailer';
const transport = createTransport({
  host,
  port,
  auth: {
    user,
    pass,
  },
});
  1. try to send mail
transport.sendMail({
  to: '',
  from: '',
  ...
})
  1. Error:
Failed in send Mail procedure
 Error: Error initiating TLS - tlssock._start is not a function
    at file:///home/dehrhard/.cache/deno/npm/registry.npmjs.org/nodemailer/6.8.0/lib/smtp-connection/index.js:1370:31
    at SMTPConnection._upgradeConnection (file:///home/dehrhard/.cache/deno/npm/registry.npmjs.org/nodemailer/6.8.0/lib/smtp-connection/index.js:905:20)
    at SMTPConnection._actionSTARTTLS (file:///home/dehrhard/.cache/deno/npm/registry.npmjs.org/nodemailer/6.8.0/lib/smtp-connection/index.js:1368:14)
    at SMTPConnection._processResponse (file:///home/dehrhard/.cache/deno/npm/registry.npmjs.org/nodemailer/6.8.0/lib/smtp-connection/index.js:953:20)
    at SMTPConnection._onData (file:///home/dehrhard/.cache/deno/npm/registry.npmjs.org/nodemailer/6.8.0/lib/smtp-connection/index.js:755:14)
    at Socket.SMTPConnection._onSocketData (file:///home/dehrhard/.cache/deno/npm/registry.npmjs.org/nodemailer/6.8.0/lib/smtp-connection/index.js:193:44)
    at Socket.emit (https://deno.land/[email protected]/node/_events.mjs:379:28)
    at _t (https://deno.land/[email protected]/node/_stream.mjs:10:32972)
    at ir (https://deno.land/[email protected]/node/_stream.mjs:10:32699)
    at Socket.w.push (https://deno.land/[email protected]/node/_stream.mjs:10:31925)

Expected behavior
I would expect sendMail to correctly work as expected in node

Environment

  • OS: Ubuntu 22.04
  • deno version: 1.28.3
  • std version:0.167.0
@dehrhard
Copy link
Author

@kt3k Any news on this? Would love to be able to use nodemailer

@kt3k
Copy link
Member

kt3k commented Mar 21, 2023

Let's track in denoland/deno#18303

@kt3k kt3k closed this as completed Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants