0

我正在使用流星电子邮件包从我的流星应用程序发送电子邮件,如官方文档中所述 - http://docs.meteor.com/#/full/email_send 但是,问题是每当收到电子邮件时,来自电子邮件地址始终与收件人电子邮件地址相同。我对这两个地址进行了硬编码,结果是一样的。代码与文档中提供的代码相同:

sendEmail: function (from, name, subject, text, to) {
            console.log("from == " + from);
            console.log("to == " + to);
            check([from, name, subject, text, to], [String]);
            this.unblock();
            Email.send({
                to: to,
                from: from,
                subject: subject,
                text: text
            });
        }

Meteor.startup(function () {
    smtp = {
        username: '<my email id>',
        password: 'xxxxxxxx', // masked - a gmail application-specific 16 character password to use for two-factor auth
        server: 'smtp.gmail.com',
        port: 587 // also tried 465 to no avail
    };
    process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' +
        encodeURIComponent(smtp.password) + '@' + encodeURIComponent(smtp.server) + ':' + smtp.port;

});

我怎样才能解决这个问题?

4

0 回答 0