Я больше не могу добавлять пользователей на свой сайт. В коде не было никаких изменений, я не перепутал его в любой форме. Я получаю сообщение об ошибке:
Exception while invoking method 'inviteUsers' { Error: Invalid login: 535 5.7.3 Authentication unsuccessful [CH2PR04CA0027.namprd04.prod.outlook.com]
I20200207-09:39:47.665(-5)? at SMTPConnection._formatError (/Users/ygerardo/.meteor/packages/email/.1.2.3.13zisy2.tjif++os+web.browser+web.cordova/npm/node_modules/node4mailer/lib/smtp-connection/index.js:558:19)
I20200207-09:39:47.665(-5)? at SMTPConnection._actionAUTHComplete (/Users/ygerardo/.meteor/packages/email/.1.2.3.13zisy2.tjif++os+web.browser+web.cordova/npm/node_modules/node4mailer/lib/smtp-connection/index.js:1254:34)
I20200207-09:39:47.666(-5)? at SMTPConnection._responseActions.push.str (/Users/ygerardo/.meteor/packages/email/.1.2.3.13zisy2.tjif++os+web.browser+web.cordova/npm/node_modules/node4mailer/lib/smtp-connection/index.js:1216:18)
I20200207-09:39:47.666(-5)? at SMTPConnection._processResponse (/Users/ygerardo/.meteor/packages/email/.1.2.3.13zisy2.tjif++os+web.browser+web.cordova/npm/node_modules/node4mailer/lib/smtp-connection/index.js:707:20)
I20200207-09:39:47.666(-5)? at SMTPConnection._onData (/Users/ygerardo/.meteor/packages/email/.1.2.3.13zisy2.tjif++os+web.browser+web.cordova/npm/node_modules/node4mailer/lib/smtp-connection/index.js:510:14)
I20200207-09:39:47.666(-5)? at TLSSocket._socket.on.chunk (/Users/ygerardo/.meteor/packages/email/.1.2.3.13zisy2.tjif++os+web.browser+web.cordova/npm/node_modules/node4mailer/lib/smtp-connection/index.js:658:51)
I20200207-09:39:47.666(-5)? at emitOne (events.js:116:13)
I20200207-09:39:47.666(-5)? at TLSSocket.emit (events.js:211:7)
I20200207-09:39:47.667(-5)? at addChunk (_stream_readable.js:263:12)
I20200207-09:39:47.667(-5)? at readableAddChunk (_stream_readable.js:250:11)
I20200207-09:39:47.667(-5)? at TLSSocket.Readable.push (_stream_readable.js:208:10)
I20200207-09:39:47.667(-5)? at TLSWrap.onread (net.js:597:20)
I20200207-09:39:47.667(-5)? code: 'EAUTH',
I20200207-09:39:47.667(-5)? response: '535 5.7.3 Authentication unsuccessful [CH2PR04CA0027.namprd04.prod.outlook.com]',
I20200207-09:39:47.667(-5)? responseCode: 535,
I20200207-09:39:47.668(-5)? command: 'AUTH LOGIN' }
Предполагается, что новый пользователь отправит электронное письмо для создания пароля. Теперь вдруг мне говорят, что у меня нет аутентификации. Вот метод:
Meteor.methods({
inviteUsers: function(emailList){
emailList.forEach((user)=>{
const currentCompany = Meteor.users.findOne({_id:Meteor.userId()}).profile.company;
if(user.email && user.first_name && user.last_name && user.role){
Email.send({
to: user.email,
from: "donotreply@especsoftware.com",
subject: "Welcome to SafeT1st",
html: '<body>\
<h3>Welcome to SafeT1st!</h3>\
<p>You have been registered as a user in our system. You will recieve another email
from us with a password reset link. Please reset your password in order to access
the system.</p>\
<p>Thanks for choosing SafeT1st!</p>\
</body>'
});
let sponsorIsEmail = user.sponsor.includes("@");
if(sponsorIsEmail){
let findSponsor = Accounts.findUserByEmail(user.sponsor);
console.log(findSponsor);
user.sponsor = findSponsor._id;
}
let userAccount = Accounts.createUser({
email: user.email,
password: SERVER_AUTH_TOKEN
});
Meteor.users.update(userAccount,{
$set: {
"profile.first_name": user.first_name,
"profile.last_name": user.last_name,
"profile.company": currentCompany,
"profile.locationId": user.locationId,
"profile.permission": user.role,
"profile.sponsor": user.sponsor
}
});
Roles.addUsersToRoles(userAccount, user.role);
Accounts.sendResetPasswordEmail(userAccount);
}else{
throw new Meteor.Error("incorrect-csv-data", "One or more of the entries were incorrect or missing required fields. If uploading a .csv file check your file. Any correct entries were still added. Please check your manage users section for all details and users. If you need further .csv assistance please download the sample .csv file.");
}
});
}
});
Код работает до тех пор, пока "Email.send ({});" часть. Я попытался перезапустить сайт, повторно загрузить код, удалить кеш и куки, искал альтернативу для отправки электронных писем.