title: how to send email with .xlsx attachment in sendgrid?
body: <p>Below is the message object used to send emails.</p>
  
  <pre><code> message = {
          to: toEmail,
          from: emailInfo.emailFromAddress,
          subject: emailInfo.emailSubjectTemplate,
          attachments: [
            {
              filename: fileName,
              content: base64str,
              contentId: fileName,
              disposition: "attachment"
            }
          ],
          html: emailMessageBodyTemplate
        };
  </code></pre>
  
  <p>The content is encoded into a base64 string by the following below code.</p>
  
  <pre><code>const base64_encode = file =&gt; {
    var bitmap = fs.readFileSync(file);
    return new Buffer(bitmap).toString("base64");
  };
  </code></pre>
  
  <p>I don't know where I m going wrong but I'm getting the error as follows.</p>
  
  <p><strong>message:"The content value must be a string at least one character in length."</strong></p>
  
  <p>but the content is not empty when I debug it is a base64 string.</p>
  
  <p>Please help.</p>