python-o365 icon indicating copy to clipboard operation
python-o365 copied to clipboard

Sending multipart emails?

Open johanovic opened this issue 5 years ago • 7 comments

Is it possible to send multipart emails, namely emails with both a body in text only and a body in html?

Thanks

johanovic avatar Dec 19 '19 19:12 johanovic

Not currently, but check the Ms graph docs

alejcas avatar Dec 19 '19 19:12 alejcas

Do you have a link to the relevant documentation?

johanovic avatar Dec 19 '19 20:12 johanovic

No... but check this as a start

alejcas avatar Dec 21 '19 23:12 alejcas

The docs claim it is possible:

When getting a message, you can specify the following request header to return the body and uniqueBody properties in text format: HTTP

Prefer: outlook.body-content-type="text"

johanovic avatar Dec 22 '19 14:12 johanovic

The docs claim it is possible:

When getting a message, you can specify the following request header to return the body and uniqueBody properties in text format: HTTP Prefer: outlook.body-content-type="text"

I'm not sure but setting this header only converts the body property of a message into plain text. You still don't have access to MIME Multipart emails.

And this still does not solve the issue of sending MIME Multipart Messages.

alejcas avatar Jan 10 '20 13:01 alejcas

Indeed, the message would not be multipart, but at least it should be possible to send text-only messages, right? (although that was not my initial question).

thanks!

johanovic avatar Jan 30 '20 09:01 johanovic

@johanovic sorry for this late response... I don't have time right know to check if setting the header when sending an email will send the email just as plain text. If you can you try it setting the boy with some html tags would be great.

alejcas avatar Apr 30 '20 09:04 alejcas