Tag: 电子邮件

试图使用nodemailer使用Gmail发送电子邮件,并收到错误:“无法为用户创build新的访问令牌”

我目前有一个设置,使用gmamail中的nodemailer发送邮件。 当我手动创build一个访问令牌(它只持续〜1小时)时,它工作正常。 但是,过了一小时后,我得到了下面的错误。 请注意,在那个小时内,我能够发送电子邮件就好,一切正常。 { Error: Can't create new access token for user at XOAuth2.generateToken (C:\Users\user\My-Projects\***\node_modules\nodemailer\lib\xoauth2\index.js:162:33) at XOAuth2.getToken (C:\Users\user\My-Projects\***\node_modules\nodemailer\lib\xoauth2\index.js:111:18) at SMTPConnection._handleXOauth2Token (C:\Users\user\My-Projects\***\node_modules\nodemailer\lib\smtp-connection\index.js:1421:27) at Immediate.setImmediate (C:\Users\user\My-Projects\***\node_modules\nodemailer\lib\smtp-connection\index.js:1239:45) at runCallback (timers.js:666:20) at tryOnImmediate (timers.js:639:5) at processImmediate [as _immediateCallback] (timers.js:611:5) code: 'EAUTH', command: 'AUTH XOAUTH2' } 我用来发送电子邮件的代码是: var emailMsg = `Name: ${name}\nEmail: ${email}\n\nMessage:\n${msg}`; var transporter = nodemailer.createTransport({ service: 'gmail', […]

Outlook Exchange Service电子邮件监视器

我想得到一些新的邮件已经到达您的收件箱及其细节的通知。 所以基本上我需要一个听众的邮箱。 就像我们有文件观察器/远程SFTP观察器和其他这样的实用程序。 请为此build议我一个解决scheme。 它可以在任何框架(Node.js,.NET等) 听说前景推送订阅,但我不清楚与他们。 我能够以编程方式从.NET交换服务器读取每个邮件。 我不想要那个,我需要一个听众

Nodemailer不断拒绝无效login身份validation(不使用Gmail)

我现在正在绕过这个最奇怪的问题。 我正在使用nodemailer和postfix发送电子邮件。 以下代码不起作用,给我以下错误: Error: Invalid login: 503 5.5.1 Error: authentication not enabled let transporter = nodemailer.createTransport({ host: 'mydomain.com', port: 465, secure: false, // true for 465, false for other ports auth: { user: 'no-reply', // user pass: 'a-hundred-percent-the-right-password' // password } }); 但更奇怪的是(更接近吓人),没有指定任何凭据的相同代码工作正常! (但当然电子邮件正在进入垃圾邮件)。 有没有人知道我可以做错什么?

Outlook中的HTML格式的msg格式

有没有任何纯粹的开源解决scheme直接从Javascript和/或NodeJSparsingOutlook味精格式? 我相信有必要在nodemailer中支持Outlook msg格式,它至less能正确parsingeml。 到目前为止,我找不到比依靠linux命令行更好的方法: 使用msgconvert linux命令从msg转到eml: sudo apt install -y libemail-outlook-message-perl cd /tmp msgconvert test\ with\ html\ content.msg # creates test\ with\ html\ content.eml 使用https://github.com/nodemailer/mailparser从eml获取信息,例如: git clone https://github.com/nodemailer/mailparser.git npm install cd mailparser/examples node extractInfoFromEml.js /tmp/test\ with\ html\ content.eml 下面是extractInfoFromEml.js的代码(只是simple.js,但接受一个参数。 'use strict'; const util = require('util'); const fs = require('fs'); const simpleParser = require('../lib/simple-parser.js'); const args […]

电子邮件validation后无法创build用户

我使用passport.js和mailgun-validate-email来尝试validation电子邮件,然后根据该电子邮件创build一个用户帐户。 我可以得到它来validation电子邮件,但它不会完成POST请求实际创build用户。 它最终会显示一个日志,但是它甚至不会给出我觉得奇怪的状态代码。 我正在用摩根来看这个。 Passport.use注册中间件 passport.use('signup', new LocalStrategy({ usernameField: 'email', passReqToCallback : true }, function(req, email, password, done) { var findOrCreateUser = function(){ console.log(req.body.email); User.findOne({ email: req.body.email }, function(err, existingUser) { if(err){ console.log(err); } if (existingUser) { req.flash('form', { email: req.body.email }); return done(null, false, req.flash('error', 'An account with that email address already exists.')); } […]

使用nodemailer通过zimbra smtp发送没有密码的电子邮件

即时通讯使用nodemailer发送电子邮件在web应用程序中使用keystonejs作为cms。 Web应用程序存储在服务器中,而电子邮件服务器存储在其他服务器中,但服务器之间的SMTP通信不需要密码。 现在,我需要发送电子邮件给其他人在需要使用通用帐户没有密码字段,因为是不是必须的。 这是我的nodemailerconfiguration: var selfSignedConfig = { host: 'smtp.abc.cu', port: 25, secure: false, // use TLS auth: { user: email.email, pass: email.password //NOT REQUIRED }, tls: { // do not fail on invalid certs rejectUnauthorized: false } }; var transporter = nodemailer.createTransport(selfSignedConfig); // verify connection configuration 和: "email": { "email": "abcde@abc.cu", "password": "" } […]

Java的邮件守护进程

我需要在java或node.js上创build类似邮件守护进程的东西我们有一个用PHP编写的高负载项目,它会生成大量的电子邮件注册/更新/等等。 目前所有的消息在处理(语言/模板)之后被放入mongodb。 我正在考虑写一个小的守护进程,它会每秒钟检查mongo中的新消息并发送出去。 我对Java或node.js有点新鲜,不想创build另一辆自行车。 有人可以指向我正确的库或类似的东西? PS:它应该是快速,asynchronous和独立的。

不要logging在Meteor.js中发送的电子邮件

当我处于开发模式时, Email.send在控制台中打印电子邮件内容。 如果我想testing电子邮件是否正常工作,这真是太好了,但是如果电子邮件太长,我想debugging其他的东西,这会让事情变得困难。 有没有简单的方法来禁用电子邮件内容的日志logging?

使用afterRemote钩子在远程方法的环回中发送响应

我正在尝试处理需要发送邮件的请求。 为了响应请求而不等待邮件发送,我正在发送一个afterRemote钩子邮件。 该方法似乎运行正常,并发送邮件,但由于某种原因,cb函数不执行,因此在客户端请求保持未答复。 问题是在console.log("Here");cb(null,{});的代码,你可以看到我有console.log("Here");cb(null,{}); 那里和第一个命令得到执行,但不是看起来第二个。 user.joinEntity = function(data, cb) { var loopbackCtx = user.app.loopback.getCurrentContext(); var userId=loopbackCtx.accessToken.userId; if(false){ cb( new Error("Cant join that Entity."),{}); }else{ user.find({where:{id:userId}},function(err,applicant_instance){ if (err) cb(err,{}); if(applicant_instance.length>0) user.find({where:{id:data.ownerId}},function(err,founder_instance){ if (err) cb(err,{}); if(founder_instance.length>0) user.app.models.EntityApplication.create({email:applicant_instance[0].email,userId:userId,EntityFounder:founder_instance[0].id,Entity:data.id,Status:"pending"},function(err,Entity_Application_Instance){ if (err) cb(err,{}); loopbackCtx.join_entity={applicant:applicant_instance[0].email,entity:data.name,to:founder_instance[0].email}; console.log("Here"); cb(null,{}); }); }); }) } } user.afterRemote('joinEntity',function(){ var loopbackCtx = user.app.loopback.getCurrentContext(); user.app.models.Email.send({ to: loopbackCtx.join_entity.to, from: […]

在NodeJS中的电子邮件和SMS排队

我正在开发一个node.js应用程序。 在我的应用程序中,我需要向满足特定条件的用户发送电子邮件和短信。 我使用Gmail SMTP电子邮件和第三方供应商的短信。 我假设射击API的电子邮件和短信服务在一个循环是危险的。 什么是正确的方法呢?