exchange server - How can I send mail in office 365 REST API? -
i've found following documentation on how send email using office 365 rest api.
this example given on doucmentation:
post https://outlook.office.com/api/v2.0/me/sendmail { "message": { "subject": "meet lunch?", "body": { "contenttype": "text", "content": "the new cafeteria open." }, "torecipients": [ { "emailaddress": { "address": "garthf@a830edad9050849nda1.onmicrosoft.com" } } ], "attachments": [ { "@odata.type": "#microsoft.outlookservices.fileattachment", "name": "menu.txt", "contentbytes": "bwfjigfuzcbjagvlc2ugdg9kyxk=" } ] }, "savetosentitems": "false" }
this works fine if user authorizes application act on it's behalf. however, using client crednetial build daemon application acts on behalf of users in given tenant hence "post https://outlook.office.com/api/v2.0/me/sendmail" couldn't work because referencing "me" , can't tell user sending email.
i appericiate if can sample example. fyi: using java answer doesn't have in java.
replace /me
bit of url /users/<userid>
. can not use /me
api call token client credentials.
Comments
Post a Comment