Automating email handling in Power Automate Desktop for Outlook and Webmail

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome rpa champions i am the rpa champion and in today's video we are going to be learning how to read and send emails using a power automate problem no coding experience would be required for this one only two things you must have a masters in quantum physics and the second thing you must have some knowledge in advanced calculus now with those two requirements checked you will be able to follow along no problem now power automate desktop will enable to automate virtually any email related process through three ways web emails outlook and exchange server now there is specific actions that we will be learning in this video such as retrieving sending and processing emails using those three that i mentioned just now now let's jump into the video and create an automation that will reply automatically to specific emails and in the process you will learn power automate some tips and tricks and suggestions that i have learned over the months of using power automate desktop now also give yourself a high five and that is because you are learning automation you will probably not be replaced by a bot if you have an office job you will be the one that is creating those bots now there is currently approximately 90 million spots in production according to a gartner research so this number is only growing so it is good to be learning this without further ado let's get the ball going and create our automation desktop robot that will solve our problem of replying to specific emails so the first thing that we're going to be doing in our power automate is creating a new flow from scratch calling it email handling this is going to be the flow that is going to hold all of our actions that are going to be handling our emails like reading deleting sending emails all right so the first thing that we're going to be doing is we have to retrieve the emails so we have to connect to the server let's look for the action that is going to allow us to retrieve email messages we add this to our process flow and then we configure it it is very easy to configure the first thing that we have to do is set up the emap and the smtp servers now you probably heard about this the e-map is just a server that is going to allow you to read emails and the smtp is going to allow you to send emails now we are going to insert our credentials and our uh our password now keep in mind that this email that i'm using is only for testing uh also keep in mind that uh if you haven't updated your power automate desktop you will be able you will be typing in plain text right now all the other all the other things you can leave them as default you should just specify the mail folder from which you need to retrieve the emails that is the only requirement for now you can leave all of the fields blank but do keep in mind that if you have a thousand messages in your email and you leave it just like this it is going to retrieve all of your email messages and it might cause a timeout or your process might take a really long time so do specify some emails or do be specific when you're receiving emails all of the emails are going to be saved in a variable that's going to be called retrieved emails and this is going to contain all of the different emails that we are going to extract from our email so this is how easy it is to be working with emails now we're going to be looking at processing emails supply delete move and mark now this is going to allow us to work with our emails so once we have retrieved them we can send them we can reply to them we can move them and so forth now the first thing that we need to do is we need to define the email message that we want to process and we get this from our variables and next we have a few options that we can do so we are going to work on the retrieved emails and we're gonna move all of these emails inside of the inbox folder so from the archive folder we're gonna move all of the in the emails inside of the inbox folder or from the retrieved emails now to do that we have to connect to the emap server now i have i think it's going to be a good idea to set some variables for this so that we don't have to input this information all the time so let's set some variables let's set the first variable this is going to be the emap server and just as a reminder from previously the emac server is used to retrieve emails from the server and you can use the gmail you can use the outlook you can use the yahoo you can use whatever service provider provides emab server to connect you can use it here there is some issues with google i will get into that later in the video so let's set the also the variable for the smtp server and let's move them all the way to the top of the page so that we can set first all the variables and then we can use the different variables inside of our process so once we have the variables at the top of the page we can go inside of our different actions and we can also change the change the names let's name this something meaningful so that we don't get confused and once we have named it something meaningful we can also change it to smtp that is perfect that is going to allow us to send emails now let's configure our actions that we have previously added that is retrieve emails and process emails now the first action is giving us errors well the last action is giving us errors but we will get into that in a second now there is a way to store our account information that is smarter than just setting variables and we are going to use the input and output so we're going to create an input variable inside of this input variable we're going to create a password we're going to set the secure text field so that nobody can see what we are typing inside and after that we are going to describe uh describe this that this is going to be the password of the account now we are using this as a global variable or an input and output meaning that you can get it from uh an outside process or maybe from the cloud for example from flow in the cloud can pass you this credentials or another process we are just saving it right now with the default value meaning that is like a global variable now keep in mind that you can use this inside of your processes if you need a variable to be accessible by all different sub flows or if you are expecting it to get it from outside now by doing this we have set out to account uh variables now we can use them inside of our flow we can see that the input and output variables are right there so if we select them we will be able to use them and insert them directly inside of the configuration to retrieve email messages so once we have retrieved the email messages once we have configured added our variables for the different for different information here we should use our we should use the variable that we have created now to select the variable it's very easy we just click on the x and we select the variable that we want to use all of the other information can stay default even though it is still good uh good to be a little bit more specific so that the process doesn't time out uh after that we are also going to configure our processing emails so we are going to do the same thing that we did in the retrieving of emails so once we have configured also the account and the password we can start using the process email messages process email messages is gonna allow us to do bulk or single individual actions on our email on our messages inside of our email box saving us loads of time for different activities now based on the different conditions that we can set up we can have it do different actions right now it is just going to move the messages inside of the archive folders inside of the messages in the inbox folder how it's going to do that it is going to retrieve them inside from with the retrieve action it is going to put them inside of variable and after that it is going to give that pass that variable of all those email messages to the next action which is processing the email and it's going to move them inside of the inbox folder so from the archive into the inbox and we see that this is actually taking a little bit of time why because we are right now using webmail we are connecting to outlook online uh via the emap server so it is taking some time to retrieve all the messages it has retrieved all the messages now if we go back to outlook we will see what is happening inside of our inbox now we can see that the messages are being slowly transferred there is nothing inside of our archive and they are slowly being transferred inside of our inbox so this is happening as the robot is processing it's taking a little bit there's a little bit of latency so that is why we are seeing those effects we can also click on the variable of retrieved emails to see more information about the emails so remember that this is not just a simple viable this is an array so you can access all of this information inside of uh inside of this array you can access information like body the attachment date from who it was sent so you can really be specific inside of your different conditions if you really need to extract different information or you need to do different actions based on the specific email all right let's test our knowledge so which platform does power auto in desktop support email handling webmail services web mail services and microsoft outlook or the above 2 and exchange server what do you think you can type the answer right below or it will appear on the screen in a few seconds so it is pretty simple right now we have seen webmail services right now after this we are going to see how we are going to use power automate to connect microsoft outlook and in the end we are also going to see how to use exchange servers so these are the three way that you can achieve emails and now let's move on to the next way so in this following way we are going to uh first finalize uh and see how we can use the snt server with the uh sending email action so what we're just going to do is from our webmail we are going to test that everything is working by sending a test email so as usual we have to connect to the different to the different information of our account so that we can connect the smtp server and after that we are going to leave most of the uh most of the parameters as default except the security parameters so once we have set up all of our account information we can finally send an email so let's just make sure that everything is set up correctly and it looks like everything is set up correctly this is going to be quite a plain message nothing fancy let's save this and let's test our process once again now we can run the process from here well actually we cannot do you know why we cannot run it from here because we are using variables so we are using the set variable and if we don't run the process from the beginning we are not going to be uh the variable is not going to be set therefore our process is going to break now let's go and change this we should change this inside not inside of a process but we should just disable the two activities before so let's save this and let's disable the two activities before and test this process so let's do this very quickly and this is how you disable two activities and let's run the process and see if it's working so it has set the two variables very quickly and now it's connecting to the server and let's see in our inside of our outlook if it has sent an email now i am reading outlook emails but this is this will work this way of sending emails would work even if you don't have outlook or if you don't have any email account available so it has worked we have managed to send an email now let's move all this information inside of a subfloor just to keep things clean and simple and also to have this maybe for a future uh for future reference or for future use this is our information is already configured the variables are already configured so it could be handy to have this saved in a subfloor so that we can use it later as well now let's move all of the diff or all everything except the set variables inside of the new subfloor that we have created once we have moved our activities to the subflow and we have our main clean now we need to look for an action that is going to allow us to run the sub flow from our main flow now we are doing this just for cleansing us and cleanliness so that we keep things organized and also so that we can reuse later on these actions that we are creating in this process so that's why we're going to create them nice and clean so that we can reuse them in the future so uh from our main flow if we add the runs subflow and we disable it it will be like it nothing has ever happened and now we can go on and create our other part of the process in this part of the process we are going to be reading emails with an outlook account so if you have outlook installed on your computer or a mail provider like like outlook well only if you have outlook you will be able to follow along now you can connect different email accounts to outlook you can connect gmail you can connect your own uh your own accounts with your own extensions and by using by using this method you can connect to any account via your outlook it will be also much faster than connecting to the web name when you are connecting to outlook directly the process is pretty much the same except we have to add the activities of launching and opening outlook so this will be the outlook that i will be opening so we have tested this and it seems like it's working so it is opening outlook it is waiting for three seconds and it's closing out these are the main actions that we need to create just to make sure that outlook is working properly now the next actions will be just like for the previous example we have to read the messages that we have in our inbox we have to identify these messages but before let's add our account now fortunately we added our account as a global variable so that we can use it all throughout our process now we need to also add the folder and let's add the folder and we can also configure other parameters as well such as the details of the email from who it was sent to who it should be sent so that we can be really specific with what kind of emails we want the robot to extract from and obviously everything will be saved in their achieved email number two because this is the second one of these actions that we have now if we continue and we repeat the actions that we have done previously so with this action we are going to be retrieving all of the messages uh the next action that we have to choose from is the send email messages so let's add that one and remember from previously to retrieve we use the imap and to send messages we use the smtp server now in our example or in this case we don't need to configure this because we are using directly outlook and power automate is connecting directly to outlook so the only thing that you need is the account that you wish to use to send the emails now previously i have used the account my previous account which which was a test account uh but it was an outlook account so in this example i will change that account to my to another account just to show you that we can use uh whatever account would with this so i have changed into my personal account that is managed by webmasters of google so it's a google uh it's hosted on the google servers i will leave all of the other fields empty and i will do the same for the send email so uh my account is connected to outlook so this will be possible i will be able to retrieve all of the email messages and i will also be able to send email messages via outlook and not via webmail and this allows me to use any kind of email that i have connected to outlook now that is very important to remember so let's play this process and see what happens so uh i do have a relatively large inbox so this might take some time however since we are connecting directly to outlook it is not taking that much time to get all of the emails and also to send a test email this was actually very simple obviously just like with the previous example we can go to the details of our variable and we can see the other property this is the email that was just now sent via this via this flow so we know that it works it works well we can also use the option of responding to messages now attention here this is a little bit peculiar there is i haven't found any documentation about this and this had me a little bit lost so when you want to select so you would select your account you would select the out instance on which you're working and then if you want to select what mail messages you would see that there is no option to select anything so there is no option because we haven't created a loop now we need to create a loop that is going to iterate through all of the messages that are inside of our inbox and and yeah and send this email as many times as there are messages inside of the inbox so what we need to do is we need to search for loops and let's add for each loop for each loop because we want our action or our flow to iterate on every single message so let's select the retrieve emails too that is the variable that we are getting produced in the received mail messages from outlook and let's move this inside of our flow but before now if we go back to our action we can see that we have the current items iteration so this is going to iterate over the current items so the current item is set to [Music] to receive emails to retrieve emails too and now we can configure all of the properties of responding to these messages so we are going to get the messages and we can respond to them however we wish inside of this loop and i will just add some sample text uh just to make this email a little bit more unique so once all of this is configured let's just make sure that all of the details that we are getting the specific email we don't want to reply to every single email so right now i've added some things inside of different parameters so just that i can be specific and you can use this as well with your processes you want to find the specific really specific emails which you would like to answer and reply to so you can be as specific as you want you can also use variables and conditions and if statements and so on so we have seen that we have run the process it has worked just fine it retrieved emails and send the email message and also responded to the outlook message now if i go to my email folder and i go inside of the skype i can see inside of the send folder that this email was sent successfully to this account so with that with that uh with that we have uh we have completed two ways of uh two ways of sending email messages one is we are webmail where we connect the smt server and to the uh to the other server the smt and the emap server to retrieve and to send emails the other way was that we've opened uh outlook on our computer and based on the accounts that are set up on outlook we selected the account that we wanted and we use that accounts and emails the main differences between the two is that the first one does is not going to work with gmail and might not also work with some other email providers why because uh because just of the settings that are changing so right now gmail is going through a process of change and some of those configuration even though you enable emap and smtp in the gmail settings it still might not work well it did not for me but you can use outlook and you can connect your gmail outlook and you can still make it work like that now the next thing now we have uh once again just like previously we have created a new subfolder we have moved all of our actions inside of the subfloor folder just to make it uh nice and clean and so that we we can reference it later on in the future now the last thing that we should do is we should i want to show you a last example of how you could another way of how you could connect your email provider get all the emails use them and send messages with them obviously if none of these methods work you can also use a more traditional approach meaning you can just spy the different elements on the web page and extract the elements and emails that you need like this however this way is much more much more reliable much less development and so forth now this last method is going to be when we connect to the exchange server now i don't have the exchange server connected but i will show you the different actions that you need to put in order to connect the exchange server now it is very straightforward and i would like to say that it is very similar to the previous to the previous example now once we connect at the connect exchange server we just have to add our email address here i will test this out my email address but obviously i don't have an exchange server so this is not going to work obviously if you do have the exchange server this is as much configuration as you will have to do to connect the exchange server and be able to retrieve emails from the exchange server now just to test this just to make sure that uh that it's not that it's not working even though i'm pretty sure that it's not working it will probably go into timeout or the connection will be refused because yes because i have not an account on this so overall i wanted uh i really wanted to clarify that there is different ways of sending emails there is really no best way the best way is obviously the most stable and most reliable way and here we can see that uh the issue was that uh i didn't have that account now uh thank you so much for watching so far i just wanted to emphasize that in this video we have seen three main ways of sending email messages now uh that as i was saying previously there is no one best way the best way depends on what is more reliable what is more stable and what requires less release development now after this video i am planning on creating another video where we are going to be using email and we are going to be connecting to some celebrities that we find online so we are going to use a robot to identify anybody's email uh out there and then we are going to use another robot to send this person an email on a single on a daily basis now to be able to follow along with that video you will have to know the things that we've seen in this video so it is good that you go over different things and you are familiar with email handling ladies and gentlemen rpa champions thank you so much for watching if you haven't done so already subscribe to the channel not to miss any more great content like this and i wish you a happy day and happy developing thank you so much
Info
Channel: RPA Champion
Views: 2,295
Rating: 5 out of 5
Keywords: microsoft power automate tutorial, microsoft power automate desktop tutorial, power automate, microsoft power automate, power automate tutorial, microsoft flow tutorial, power automate desktop, microsoft automate, powerautomatedesktop, power platform, power automate desktop introduction, power automate desktop tutorial, power automate desktop web automation, power automate desktop app, power automate desktop flow, power automate desktop free, microsoft flow, flow, rpa champion
Id: CL22UNkMA8Q
Channel Id: undefined
Length: 25min 5sec (1505 seconds)
Published: Tue May 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.