Send Gmail message with attachment
- 30 May 2023
- 1 Minute to read
- DarkLight
Send Gmail message with attachment
- Updated on 30 May 2023
- 1 Minute to read
- DarkLight
Article Summary
Share feedback
Thanks for sharing your feedback!
To send a Gmail message with a file attached, you will encode the file as a Base64 string and use the Gmail Send Message step and the Encode base64 utility step.
- Pass the file or information you desire to use as an attachment through the Encode base64 step, before the Gmail step.
- In the Gmail Send Message step, fill out any necessary parameters such as recipients, subjects, and access tokens.
- In the Content type parameter, write:
multipart/mixed; boundary="XXXXboundary text"
- You can replace
"XXXXboundary text"
with any other text which will be used as the boundary in the message.
- You can replace
- Each attachment must be inside its own section of boundary text.
- The Content parameter should be formatted as below:
This is a multipart MESSAGE_TEXT
--XXXXboundary text
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">This is a message with an attachment.<div><br></div>
--XXXXboundary text
--XXXXboundary text
Content-Type: text/plain; name="file.txt"
Content-Disposition: attachment; filename="file.txt"
Content-Transfer-Encoding: base64
{{ $.encode_base64.result }}
--XXXXboundary text
Was this article helpful?