Reactjs &引用;“内容类型”;在JavaScript中显示意外标记

Reactjs &引用;“内容类型”;在JavaScript中显示意外标记,reactjs,smtp,zip,attachment,content-type,Reactjs,Smtp,Zip,Attachment,Content Type,我正在使用SMTP从我的ReactJS应用程序发送ZIP文件。 我可以将PNG图像作为atachments发送,而无需将任何“内容类型”指定为SMTP属性 但当我为发送zip文件添加内容类型:“application/octet stream”时,它在“-”处显示了意外标记 我应该用什么替换它来发送zip文件 这是我的SMTP连接代码 sendEmail = (url, filename)=> { Email.send({ Host: "smtp.gmail.com

我正在使用SMTP从我的ReactJS应用程序发送ZIP文件。 我可以将PNG图像作为atachments发送,而无需将任何“内容类型”指定为SMTP属性

但当我为发送zip文件添加
内容类型:“application/octet stream”
时,它在“-”处显示了意外标记

我应该用什么替换它来发送zip文件

这是我的SMTP连接代码

sendEmail = (url, filename)=> {
      Email.send({
      Host: "smtp.gmail.com",

      Content-Type : "application/octet-stream",

      Username : "xxxxx@gmail.com",
      Password : "xxxxxxxxxxxxxx",
      To : 'xxxxxxx@gmail.com',
      From : "xxxxx@gmail.com",
      Subject : "Your file is ready! ",
      Body : "Body of the Email",
      Attachments : [
        {
            name : filename,
            path : url
        }]
      }).then(
        message => alert("Mail Sent")
      );
    }
这就是它所呈现的

尝试将内容类型替换为“内容类型”。像这样

Email.send({
      Host: "smtp.gmail.com",
      "Content-Type" : "application/octet-stream",
      Username : "xxxxx@gmail.com",
      Password : "xxxxxxxxxxxxxx",
      To : 'xxxxxxx@gmail.com',
      From : "xxxxx@gmail.com",
      Subject : "Your file is ready! ",
      Body : "Body of the Email",

尝试将内容类型替换为“内容类型”。像这样

Email.send({
      Host: "smtp.gmail.com",
      "Content-Type" : "application/octet-stream",
      Username : "xxxxx@gmail.com",
      Password : "xxxxxxxxxxxxxx",
      To : 'xxxxxxx@gmail.com',
      From : "xxxxx@gmail.com",
      Subject : "Your file is ready! ",
      Body : "Body of the Email",

它清除了解析中的错误(感谢:-)。但它仍然没有发送任何包含zip文件作为附件的电子邮件:-(它清除了解析中的错误(感谢:-))。但它仍然没有发送任何包含zip文件作为附件的电子邮件:-(