Microsoft 365 - Create Message, Get ID, Move to Folder (No sending)

Hello,

Here is what I want to achieve: I want to create a mail message in an Mailbox Folder (with an attachment), without actually sending it. The reason for which is I receive e-mails from clients with multiple attachments. We process them one at a time, some succeed, some fail.

With the failed ones, I’d like to create a single message with the attachment so our operators can take a look at the issue.

I can create an e-mail using the Send Mail activity and using the Is Draft property, it can be withheld from sending. I was hoping to get the message ID at that point, so I can move it to a folder in the mailbox for the attention of our staff. As the Send Mail activity uses the Create Message GraphAPI, which returns the message ID, I had hoped this would be part of the Send Mail activity.

Do I ditch the UiPath package and just make my own calls to Graph API or does some have a way to do this?

I’m going to be able to call the Get Mail on the Drafts folder and hope that it’s the latest one or I embed something in the e-mail when I create it that I can look for so I guarantee I get my message back. It all just feels a bit sloppy when the Graph API is sending that back during Create Message!

Any ideas? Is there another package I should use for just calling Create Message?

Thanks

@steven.mckinstray

This is the option you have…or use the graph api call directly…then send email activity would not return I believe as you mentioned

Cheers

I didn’t think I would be able to combine the two.

It might be handy for a future build to return that Message ID in an optional OUT parameter on Send Mail, so it can be accessed directly and I don’t have to search for the Message again afterwards. For now, it should be sufficient to recall the latest Draft e-mail and maybe by e-mail subject too. It’s not rock solid, but if a member of the team happened to be writing an e-mail at the same time, it would pick up mines.

@steven.mckinstray

You can try giving filter on the unique body as well…that might be different right…

Cheers

Thanks,

Now you say that, I was thinking of hiding a GUID somewhere in the e-mail body in white text or inside an HTML tag, so I could grab it later. I might go down that route if this doesn’t prove to be to reliable.

Cheers

1 Like