0

What I am doing

I am strictly following the Gmail API guide - https://developers.google.com/gmail/api/guides/sending
https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send

From the sample code given for both sending a simple mail and mail with an attachment. I learned from these codes that we need to send Base64 encoded value as "raw" as per RFC-2822.

Sending mail without attachment

I am able to encode the below RFC 2822 format in Base64 and send mail successfully.

From: automationreportbyamod@gmail.com
To: automationreportbyamod2@gmail.com
Subject: Saying Hello
This is a message just to say hello.
So, "Hello".

enter image description here

Sending mail with attachment

From the example code with the attachment, I see that we need to encode email content with the attachment in Base64. But if we want to do the same using Postman, how can I encode a simple format with a file to be uploaded?

Note - As explained here, I have tried the raw as text and passed the attachment file as Base64 and that is working as well. But I want to make it work as shown in the example code here using Postman.

Christian Baumann
  • 3,188
  • 3
  • 20
  • 37
AMOD MAHAJAN
  • 152
  • 1
  • 10

0 Answers0