79643372

Date: 2025-05-29 06:03:30
Score: 0.5
Natty:
Report link

You are in right path in creating a message in specified folder in outlook. when you create a message, by default it will be drafted in Drafts folder. You can move the message to specified folder using /messages/message-Id/move endpoint. However, isDraft value will be in true state until you send the message using /messages/message-Id/send and this is expected.

In my case, I used sample python code to convert MIME message to Base64-Encoded MIME String.

import  base64
from  email.message  import  EmailMessage

msg  =  EmailMessage()
msg['From'] =  '[email protected]'
msg['To'] =  '[email protected]'
msg['Subject'] =  'Test Email via Microsoft Graph API'
msg.set_content('Hi...This is the body of the email in MIME format. \n  \n Thanks')

raw_bytes  =  msg.as_bytes()
base64_encoded  =  base64.b64encode(raw_bytes).decode('utf-8')
print("Base64-Encoded MIME String:\n")
print(base64_encoded)

enter image description here

enter image description here

enter image description here

Successfully created message and sent

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Deepthi R