Проблема при отправке нескольких отдельных электронных писем с помощью nodemailer - PullRequest
0 голосов
/ 15 февраля 2020

У меня есть список писем, и я пытаюсь отправить отдельное письмо каждому получателю с помощью nodeMailer. Я могу отправить сообщение одному контакту, а в некоторых случаях двум. Я сталкиваюсь с ошибкой: Error while sending mail: Error: Message failed: 432 4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded [Hostname=HE1PR05MB4779.eurprd05.prod.outlook.com].

Хотя я пытаюсь отправить одно электронное письмо для каждого соединения, эта ошибка возникает. Ниже приведен код.

const nodemailer = require('nodemailer');
const transport = nodemailer.createTransport({
        pool: true,
        service: "Hotmail",
        auth: {
            user: "xxxxxx@hotmail.com",
            pass: "xxxxxxxxxxxx"
        }
    });
var mailOptions = {
        from: "souleimanfadal@hotmail.com",
        to: currentEmail,
        subject: "Testing Bulk Emails",
        text: "Sample text", 
    };
    transport.sendMail(mailOptions, (error, info) => {
        if (error) {
            return console.log('Error while sending mail: ' + error);`

        } else {
            console.log('Message sent: %s', info.messageId);
                transport.close();
        }

У меня есть массив писем, и я зацикливаюсь на массиве, чтобы каждый раз передавать по одному письму.

var another= require('./local.js');
var another2= require('./a.js')
var counter=0;

for (email of another2.data){
var currentEmail = another2.data[counter];

        another.data.myFunction(currentEmail);
        counter++;
}

И вот результат ошибка при отправке писем на 6 контактов:

Error while sending mail: Error: Message failed: 432 4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded [Hostname=HE1PR05MB4779.eurprd05.prod.outlook.com]
Error while sending mail: Error: Message failed: 432 4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded [Hostname=HE1PR05MB4779.eurprd05.prod.outlook.com]
Error while sending mail: Error: Message failed: 432 4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded [Hostname=HE1PR05MB4779.eurprd05.prod.outlook.com]
Error while sending mail: Error: Message failed: 432 4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded [Hostname=HE1PR05MB4779.eurprd05.prod.outlook.com]
Error while sending mail: Error: Message failed: 432 4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded [Hostname=HE1PR05MB4779.eurprd05.prod.outlook.com]
Message sent: <5ec76009-187a-94a8-9960-bde465496ee1@hotmail.com>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...