Senden von E-Mails über Google Mail SMTP - Meteorjs

Hallo, ich versuche mein gmail-Konto senden Sie E-Mail für meine Meteor-app, nicht sehr einfach so weit

server.js

Meteor.startup(function () {
  smtp = {
    username: 'xxxxx',   //eg: [email protected]
    password: 'YYYYYYYY',   //eg: 3eeP1gtizk5eziohfervU
    server:   'smtp.gmail.com',  //eg: mail.gandi.net
    port: 465
  }

  process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' + encodeURIComponent(smtp.password) + '@' + encodeURIComponent(smtp.server) + ':' + smtp.port;
});

Email.send({
  from: "[email protected]",
  to: "[email protected]",
  subject: "Meteor Can Send Emails via Gmail",
  text: "Its pretty easy to send emails via gmail."
});

Und die Test-E-Mail nie gesendet, mit der unter Fehlercode zu sagen, dass ich haben setzen Sie die Umgebungsvariable.

I20150715-18:14:02.641(0)? ====== BEGIN MAIL #0 ======
I20150715-18:14:02.642(0)? (Mail not sent; to enable sending, set the MAIL_URL environment variable.)
I20150715-18:14:02.643(0)? MIME-Version: 1.0
I20150715-18:14:02.643(0)? From: [email protected]
I20150715-18:14:02.643(0)? To: [email protected]
I20150715-18:14:02.643(0)? Subject: Meteor Can Send Emails via Gmail
I20150715-18:14:02.643(0)? Content-Type: text/plain; charset=utf-8
I20150715-18:14:02.643(0)? Content-Transfer-Encoding: quoted-printable
I20150715-18:14:02.644(0)? 
I20150715-18:14:02.644(0)? Its pretty easy to send emails via gmail.
I20150715-18:14:02.645(0)? ====== END MAIL #0 ======

Könnte dies zurückzuführen sein, den ich bin mit dieser auf C9?

Dank

  • scheint diese links helfen u One & Zwei
  • nicht sicher, ob dies helfen wird, aber vielleicht versuchen Sie port 25 oder 587. Abhängig von Ihrer Konfiguration: support.google.com/a/answer/176600?hl=en
  • Vielleicht ist es, weil ich kippe setzen Sie die Umgebungsvariable meiner Test-site in der Cloud9-Plattform?
InformationsquelleAutor Tom chan | 2015-07-15
Schreibe einen Kommentar