hello folks welcome back in this video i will show you
how to collect shared mailbox email messages
and save them to sharepoint document library so stay tuned and let's go to
the demo after this short intro
now if you are interested in saving email body and attachments to a
sharepoint list i've made another video on this topic
which you can access by clicking the link on the top right corner of this
video now let's carry on with the original topic first
i will create a shared mailbox in office 365 and give myself permission to manage
this mailbox then i will create a power automate flow
which will listen to this shared mailbox and forward
the incoming emails to sharepoint document library automatically i will
also capture some email properties in SharePoint document library metadata
fields like email from address and date received now we have
set the same so let's crack on i'm inside office 365
landing page from the top left corner i will click on this ellipses
and go to admin here under this groups drop down
i can see shared mailboxes link so i will click on it
this will show me any shared mailboxes in this office 365 tenant i already got
one customer's shared mailbox i will create 0:01:18.560,1193:02:47.295 a new one add a shared mailbox i will click on
that i will give this a name i will just call it test the email
address will be test at domain in your tenant so i will click on
save now the shared mailbox is created you can
now add members to your shared mailbox or you can just cross this one and come
back and click on the mailbox name and then here you can
do various things one of them is how to add members into shared
mailbox so this is where i will show you you can
add members to this shared mailbox also if i click on edit and
click on add members and then i will select my name and click
save and click close now my name is added as a member in this
shared mailbox which means i got access to this shared mailbox as well
click on close now the shared mailbox is set up
now if i go back to office 365 i need to navigate to shape one side where i will
be saving the incoming emails in a document
library so i need to set that up i'll go to sharepoint training site
from here i can create a document library
so if i go to site content and click on new
document library i will just call it incoming email
library and by default there are some columns there with the name column
i will just add another column single line text
so this will be the from email address column so we can save the information
there let me add another column the date the
email is received this will be a date and time column save
we're going to populate the form address and the date received
as well as the the email message in this document library next i
will create a power automate flow which will root the email to the
document library so from the office 365 left-hand menu i
can see the power automate icon here so i will click on that this will take me
to the power automated application landing page
from the left hand menu i need to click on create and then i need to select
automated flow because i want that email when it arrived in that shared
mailbox automatically and go to the document library so i will
click on the automated flow i will give this flow a name just call
it test email and then the trigger for this will be
when an email arrived in a shared mailbox so when i type
mailbox i can see that when an email is arrived in the shared mailbox trigger so
i will select that click create now in this trigger i need
to provide the mailbox address we know we have created
that test mailbox earlier on so we'll provide that address here and then if i
go to show advanced option make sure that
you select include attachments to yes so if you don't select that although
the you will see that email will have
attachments but when you open it it will not open it will throw errors so
make sure that you include attachments here okay the next
step we want is to export this email so i will just
type export so export email office 365 outlook
action i need to select that and then the message id i will provide
the message id from the previous step so message id will go there so the next
step is we're going to create the record in the library so we need to create a
new document in the library with this email message so the action we
want is the create file sharepoint action
we will select site address training site and the folder path is going to be
the document library path which we have created earlier on
incoming email and the file name i will put subject
here but now in the document library if a new
email arrives in the future with the same subject the
workflow will fail because it will say that
this document already exists now to make it unique
i can just put - and then maybe i just put
receive time so this will make this subject unique
for each file so the file name will be unique and
one more thing i need to do is i need to save this file as a type dot eml so this
will be the message type and then the file content is going to be
the body of that exported email action from
the previous step so i will select the body if i close this one
and then open it again i notice this happen in power automate that dot eml
extension is gone so if i just make sure that you close
and open again and see that if it's gone you put it back in dot eml
now this time if i close it and open this action
it's staying there so i don't know why it's happening but it happens to me so
i'm just making you aware that it could happen to you as well so the next step
is going to be i need to update the properties
for this library as well so if i go back to the library so we have from address
and data see these are the two properties we need to populate
with this message file as well so if i go back to power automate click on new
step so i'm interested in update file
properties so i'll select that action of sharepoint i will give this
site address again and the library name is going to be
incoming email and the id now we can get the id from
the previous create file step item id and from address this is when
the email arrives we have from address as well
and the date received that's again when an email arrived in the share mailbox we
have received time we'll put the information there so just
to do a summary we have write a trigger which will look
into this test mailbox and we made attachments to
yes included and then we exported the email and
provided a message id from the previous step and then we created a file with dot
eml extension and the file content will be body of this
exported message and then we updated the file properties for that file so i will
click on save which will save this workflow so we can test it
so the workflow is saved now i will send the email to this
test shared mailbox and i'll put a subject let's call it this is a test
subject and this will be the body of the email i
can attach a document i can go to browse to this computer so
i'm attaching this sample pdf file here i will click on send now i will wait for
a little bit once the workflow run then we should see the email message
here i will pause the video for now and come back when the email message is
arrived now the workflow is running so if i
click on this one i can see the workflow run successfully if i go back to the
library i can see a new record is created here and the
from address and date receive also populated
and this is going to be dot eml message type as you can see
here so if i click on this link this will open up the email body in the
browser and you can see that this attachment
sample pdf attachment is there as well so if i click on download
this will download this email message locally to my pc
so if i click on that it will open that message and also any attachment with it
so if i click on the attachment so the attachment will be opened here so
to just do a wrap of this video today you have learned how to collect
shared mailboxes email messages and save them into sharepoint document
library along with other metadata properties
and you can also download them and view an attachment with the email as well
thank you for watching this video consider subscribing if you're new to
the channel by pressing the red subscribe button below this video
and click the notification bell icon so you don't miss any of my future videos
as i upload new videos every week give this video a thumbs up if you found it
useful if you have any question regarding this
topic or any other query related to office 365
put in the comment section below i review my comments on the daily basis
i will be happy to answer thank you