xpepermint / smtp-client

Simple, promisified, protocol-based SMTP client for Node.js.
36 stars 13 forks source link

SSLTLS How to change version? I need ssltls version 1 #6

Open dengine opened 4 years ago

dengine commented 4 years ago

[Error: 13308:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:332: ] { library: 'SSL routines', function: 'ssl3_get_record', reason: 'wrong version number', code: 'ERR_SSL_WRONG_VERSION_NUMBER' }

cyborch commented 3 years ago

I'm seeing the same issue. It seems like it might be an issue in the underlying node TLS routines. I cannot tell if it is a configuration issue or what it is, but for now, only plain text connections work, which is a bit of an issue.

dancs85 commented 3 years ago

I've managed to get STARTTLS working with SendGrid. These are the commands used:

try {
    await smtp.connect();
    await smtp.greet({hostname: SMTP_SELFHOSTNAME});
    await smtp.secure();
    await smtp.greet({hostname: SMTP_SELFHOSTNAME});
    await smtp.authPlain({username: SMTP_USERNAME, password: SMTP_PASSWORD});
    await smtp.mail({from: SMTP_FROMADDRESS});
    await smtp.rcpt({to: destinationEmail});
    await smtp.data(header + body);
    await smtp.quit();
  } catch (err) {
    console.log('Error sending email:', err);
  }