Can't send an email with an attachment

:bullseye: What is your goal?

I want to sent a file from an attachment with the module Gmail send a email.

:thinking: What is the problem & what have you tried?

I tried to send a file to mailbox for a trial. But each time I have 2 errors when to choose the name of the file. Here is the 2 parameters.

:clipboard: Error messages or input/output bundles

Error
Couldn’t build a valid attachment filename in Google Email: Send an Email module 6. The mapped {{5.filename}} value was empty or invalid in both attachment and image names.

Possible fixes:

Re-map the File name field to a real filename from module 5.
Use ifempty({{5.filename}}; “fiche-de-pret”) for a fallback name.
Remove the image block if you only need the PDF attachment.

:link: Create public scenario page

https://eu2.make.com/public/shared-scenario/BLfs3tejx6X/automatisation-et-relances

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Here is the second screenshot. Thanks for your help.

Hello,

According to MIME syntax, / is a special character in MIME parameter values and should not appear in an unquoted filename parameter. This looks like it may be your case, since the filename uses a DD/MM/YYYY date format.

The Gmail API sends messages as raw RFC/MIME messages, so the attachment filename still needs to be valid MIME. I would recommend replacing / with - or _, for example DD-MM-YYYY, because / is also commonly treated as a path separator.

It should solve your problem :slight_smile:
Have a nice day

Hello Michal,

I’m sorry to bother you again. I replaced DD/MM/YYYY with DD-MM-YYYY but I still have issue with the file name. I renamed it without accent and doesn’t work. Where I’m wrong this time ?

Hi there,

I’m not sure why this isn’t working, but a workaround you could try is to use the Google Drive Module to download the file as a PDF (instead of the Google Docs Module) like this:

I hope this helps :grinning_face:

Have a nice evening!