• Introduction
  • Tutorial
  • User guide
  • SDK
  • Examples
  • File attachments

    Adding file attachments is possible in two ways – by passing the attachment content programmatically through the emailjs.send() call, or by allowing the user to upload a file. The latter is done by creating a form with a file input field, and sending the email via emailjs.sendForm(). To get started with either option first open your template editor, scroll down to the Attachments section, and add an attachment. See below a description of each parameter.

    Attachment type

    Parameter name

    Specifies the name of the input field for the file upload. The input should be of type “file” and be part of the form passed to the sendForm() call.


    Specifies the file name of the attachment (e.g. “image.png”).

    Content type

    Specifies the content type of the attachment (e.g. “PNG”).


    For the attachments of type “Code file upload”, this field contains the content of the attachment encoded in Base64 or URL.