Youans / nodejs-nodemailer-outlook

Simple integration module for outlook.office365 smtp servers
Apache License 2.0
36 stars 12 forks source link

Problem sending emails to gmail #19

Open GenLoya opened 2 months ago

GenLoya commented 2 months ago

Problem

I am a problem sending emails from my enterprise domain to gmail, when i use it the send is rejected and launch the email in the screenshot. image

Code

const transporter = createTransport({
    host: 'smtp.office365.com',
    service: 'Outlook365',
    port: 587,
    sender: false,
    auth: {
        user: process.env.EMAIL_USER,
        pass: process.env.EMAIL_PASSWORD,
    },
    tls: {ciphers: 'SSLv3'},
})

transporter.sendMail(
    {
        from: process.env.EMAIL_USER,
        to: ['genarodour2104@gmail.com', backupEmail],
        subject: `4T Ranch Register ${nowPdf}`,
        attachments: [
            {
                filename: `Hola.pdf`,
                content: pdfBuffer,
            },
        ],
    },
    (error, info) => {
        console.log(error, info)
    },
)