Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 无法为事件创建google卡_Node.js_Email_Node Modules_Google Now - Fatal编程技术网

Node.js 无法为事件创建google卡

Node.js 无法为事件创建google卡,node.js,email,node-modules,google-now,Node.js,Email,Node Modules,Google Now,我的要求是使用名为的节点模块创建一个直通电子邮件。用我找到的。我创建了一个标记,并使用。当我通过教程中提到的方式发送邮件时,我可以创建谷歌卡,但当我通过发送邮件时,我无法创建谷歌卡。有人能帮我解释一下为什么我无法创建googlenow卡吗 我的电子邮件模板如下: <html> <head> <script type="application/ld+json"> { "@context": "http://schema.org",

我的要求是使用名为的节点模块创建一个直通电子邮件。用我找到的。我创建了一个标记,并使用。当我通过教程中提到的方式发送邮件时,我可以创建谷歌卡,但当我通过发送邮件时,我无法创建谷歌卡。有人能帮我解释一下为什么我无法创建
googlenow卡吗

我的
电子邮件
模板如下:

<html>
   <head>
   <script type="application/ld+json">
       {  "@context": "http://schema.org",
          "@type": "EventReservation",
          "reservationNumber": "E123456789",
          "reservationStatus": "http://schema.org/Confirmed",
          "underName": {
                   "@type": "Person",
                   "name": "John Smith"
           },
          "reservationFor": {
             "@type": "MusicEvent",
             "name": "Foo Fighters Concert",
             "url": "http://foofighterstour.com/SFO",
             "performer": {
                 "@type": "Person",
                 "name": "The Foo Fighters",
                 "image": "http://www.amprocktv.com/wp-content/uploads/2013/01/foo-fighters-1-680x383.jpg"
  },
        "startDate": "2015-08-20T16:10:00+05:30",
        "endDate": "2015-08-20T16:20:00+05:30",
        "doorTime": "2015-08-20T16:01:00+05:30",
        "location": {
               "@type": "Place",
               "name": "Random Park",
               "address": {
                   "@type": "PostalAddress",
                   "streetAddress": "1 Random Street",
                   "addressLocality": "New Delhi",
                   "addressRegion": "Delhi",
                   "postalCode": "110001",
                   "addressCountry": "IN"
                }
           }
       },
       "ticketToken": "qrCode:AB34",
       "ticketNumber": "abc123",
       "numSeats": "1",
       "modifiedTime" : "2015-08-20T16:05:00+05:30",
       "modifyReservationUrl" : "http://www.google.com"}
     </script>
  </head>
  <body>
    <p>
    This a test for an Event reservation Google Now card in Gmail.
    </p>
  </body>
</html>
       var fs = require('fs');
       var nodemailer = require('nodemailer');
       var transporter = nodemailer.createTransport("SMTP", {
           service: 'Gmail',
           auth: {
               user: 'xyz@gmail.com',
               pass: '123456'
           }
       });
       fs.readFile('emailTemplatePath', "utf8", function (err, data) {
           var mailOptions = { 
               from:'xyz@gmail.com'             // sender address 
               to: 'xza@gmail.com', // list of receivers 
               subject: 'Booking reservation', // Subject line 
               html: data
           };
           transporter.sendMail(mailOptions);
       });

当您从nodemailer发送邮件时,您是否正在接收邮件?同时检查html中的日期,如果时间低于当前时间,它可能不会显示在google nowHi中我正在通过我的gmail帐户接收邮件,并将时间设置为今天的时间,但google卡仍然没有生成。即使我将日期更改为2015-08-21T11:30:00+05:30,它仍然不会生成谷歌卡!!!测试电子邮件需要使用DKIM/SPF签名进行签名/验证,如()所述。我也看到你从xyz@gmail.com到xza@gmail.com,它甚至无法使用应用程序或脚本。“from”和“to”必须相同才能工作。如果你有一个谷歌应用程序域,你可以注册成为内部使用的白名单。你可以在这里找到更多关于注册的信息()。Franco,有没有办法从一封电子邮件发送到另一封电子邮件来创建谷歌卡片?您还可以建议我如何确保使用一些npm模块进行电子邮件身份验证。@shubham agiwal您必须被列入非个人电子邮件的白名单,才能发送到其他Gmail帐户。基本上,注册一个非Gmail/Yahoo电子邮件帐户,查看他们的注册页面(developers.google.com/Gmail/markup/registingwithGoogle)。我能够找到关于使用Nodemailer进行身份验证的过去答案(请参阅此链接的顶部答案()。当您从nodemailer发送邮件时,您是否正在接收邮件?并检查html中的日期,如果时间低于当前时间,它可能不会显示在google nowHi我正在通过我的gmail帐户接收邮件,并将时间设置为今天,但仍然不会生成google卡。即使我将日期更改为2015-08-21T11:30:00+05:30它仍然没有生成google卡!!!测试电子邮件需要使用()中提到的DKIM/SPF签名进行签名/验证。我还看到您从xyz@gmail.com到xza@gmail.com,使用应用程序脚本或。从和到要使其正常工作,需要相同。如果您有谷歌应用程序域,您可以注册成为白名单供内部使用。您可以在此处找到有关注册的详细信息().Franco,有没有办法从一封邮件发送到另一封邮件中创建谷歌卡片?您能否建议我如何确保使用一些npm模块进行电子邮件身份验证。@shubham agiwal为了发送到其他Gmail帐户,您必须将您的非个人电子邮件列入白名单。基本上,请向非Gmail/Yahoo电子邮件帐户c注册查看他们的注册页面(developers.google.com/gmail/markup/registing with google)。我能够找到关于使用Nodemailer进行身份验证的过去答案(请查看此链接()的顶部答案)。