Email / Sendmail and attachments

System Information
  • **Strapi Version 3.6.1:
  • **Operating System ubuntu:
  • **Database sqllite:
  • **Node Version 12:

Should the sendmail provider handle attachments out of the box? I’ve been sending attachment data through a form with the following code and nothing is attached when the emails are received:

const bodyFormData = new FormData();
bodyFormData.append(‘to’, Email);
bodyFormData.append(‘subject’, “Website Contact Form”);
bodyFormData.append(‘text’, msg);
bodyFormData.append(‘attachments’, attachment);
bodyFormData.append(‘to’, Email);

axios({
  method: "post",
  url: process.env.NEXT_PUBLIC_ASSET_URL + '/email',
  data: bodyFormData,
  headers: { "Content-Type": "multipart/form-data" },
})
  .then(function (response) {
    console.log('email sent');
    setErrorMsg("Thanks, Email sent.");
  })
  .catch(function (response) {
    setErrorMsg("Error, Email not sent.");
    console.log(response);
  });

attachment contains the following data:
{
“content”: “�PNG\r\n\u001a\n\u0000\u0000\u0000\rIHDR\u0000\u0000\u0000�\u0000\u0000\u0000�\b\u0006\u0000\u0000\u0000w\u0012p�\u0000\u0000\u0000\tpHYs\u0000\u0000\u000b\u0013\u0000\u0000\u000b\u0013\u0001\u0000��\u0018\u0000\u0000\u0004�IDATx���o��c\u001c��G"֌�m�\u0014^H-^\u0010E�dx%��m�J�?o�ɟ�1Q\u0012�jL�\u0016˶��\u0016\u0011��i�Zj\u001d&��"�W\u0017ϩ{�ٳ��:����吏��s]���{���{�0\r�z\u0013�%e�\t�\u0007.����h�i�j�m�;ʱ\u0017�\n�\t�8��\\r�!����\u0007]�\u0006���S��ШH�\u0010�/�e�x�\n\u0005|N<�\u0000s�.f\u0005q�\u0003N\u001fqVc\r�A\\[�\u000b�\u000b�@l��ZC��ۈ��1�;��¾�(\r0A|oL.�\u0003갪�0J\u0002�O=�\u0005�H\u001d6�\u001dGI���cQZP-��;��\u00007S��j\nu{�q��:>HMZf���P��\u0015��P�e�-�Z.Cm1�r\u0019j����P[\f�\\��b�*E3\u0018�PU��P\u0015Ac���1TE�\u0018�\"h\fU\u00114��\b\u001aCU\u0004��*��P\u0015Ac���1TE�\u0018�\"h\fU\u00114��\b\u001aC��g�1z�;H��R�%>�_)|��X>��b��2�\u0016C-���\u0018j�\f��P�e�-�Z.Cm1�r\u0019j������A�;%��&-h7u���\u0002\I=.H\u000b�H\u001d\f�\u00058�:�\u0006\u001cQ�o�G�� ��6�{����)��6���o�&�3�\u000b:\u000b����O9��\u0007<K\w��\u0000���OĖ�R񨱯s\n�y�ypԂN\u0001^$�\u0007\u000e��1\u0006,\u0001��|���,3]�I�-������p\u0013�{\u001d/vA��\u000f\n�\bX\u000bl����W�8�\u0003�=(\u001d�n��n�{=���\u0003]���{M�T�o���\u000f~�c2�U�\u0003X�a�{�#=+u\u000e8\u001c��a�k=&e\u0001��a�魄�*�>\fu\u0018��*��Kt�q��\u00006t\u0018��*��Ja\u0000�wxUu\\�<�\u001ct\u0018XW\u001cW)\u000fY��:�R>��\u0014�����ݎ��G��P�R\b顯\u000e��������\u0001����J�\u0000;;�ջ��\u0007��nyw��\u00006w\u0018��e\u001dW����+>\f�<���G��\u0003O\u0003�\u000e?���9)\u000b��3�F�G�Y\u0005�4�@�\u0006��h�+��\u0011��\f\u001c�\u0011��qպ�6i?�+g��n��\u0003��\u001aW�\t\u001c���$M\u000bx\u0014�\u00068�-R��c�K��;\u000f���Wz�}r�\u001dR8i\u0012\u0000�\u0019�VK�=�\f���RO���>�Xg,c\u0006������w�%������T.���]��G\u001a�����(M\u0003��#�R1�\t갫�TF�o����R1�\u0015�q|���L�רGc(�2T��\n�P\u0015��*\u0004CU\b��\u0010\fU!\u0018�B0T��\n�P\u0015��\u0004CU\b��\u0010\fU!\u0018�B0T��\n�P\u0015��*\u0004CU\b��\u0010\fU!\u0018�B0T��\n�P\u0015��*\u0004CU\b��\u0010\fU!\u0018�B\u0000^�\u001e�����\u0004x�:|k$\u0015\u0003��\u000e\u001b��Ke\u0006L\u0010�ņR9%�m�{\u000f5K�-�4ᷡ�\u0011�0�9b�\u0001,�{��\u0003q�jq��Ez�b J��\u0007�\u0002n\u0007V\u0017�\u000fX\n,�x\u0006�\u0013�\u00134�&��>\u0000\u0000\u0000\u0000IEND�B`�”,
“filename”: “project-diagram-solid.png”,
“type”: “image/png”,
“disposition”: “attachment”
}

What am i doing wrong here?