Skip to content Skip to sidebar Skip to footer

Use Smtp Client To Send Email Without Providing Password

I'm using nodemailer to try to send an email to myself via commandline: var nodemailer = require('nodemailer'); // config var smtpConfig = { host: 'smtp.myhost.com', port:

Solution 1:

Try port 587.

Here are my gmail settings.

smtpServerName="smtp.gmail.com" 
portNumber="587" 
authenticationMode="SSL" 
smtpUserName="somebody@gmail.com" 
smtpUserPassword="xxxxxxxxxx"

I would experiment with ssl: false and ssl: true

nodemailer.SMTP = {
    host: 'smtp.gmail.com',
    port: 587,
    ssl: false,
    use_authentication: true,
    user: 'my.username@gmail.com',
    pass: 'my.password'
}

Make sure you read this:

https://support.google.com/accounts/answer/6010255

It looks like there are two ways with gmail.

Port 587 is (non ssl) but with TLS.

Port 465 is SSL (but not TLS).

Go figure.

    //singleServer = new SmtpServerSettings("smtp.gmail.com",
    //      "myname@gmail.com", "587", AuthenticationType.Basic,
    //    "myname@gmail.com", "mypassword", "");

    //singleServer = new SmtpServerSettings("smtp.gmail.com",
    //      "myname@gmail.com", "465", AuthenticationType.SSL,
    //      "myname@gmail.com", "mypassword", "");

Post a Comment for "Use Smtp Client To Send Email Without Providing Password"