I quote from another post (I don't remember now). Hope to help you:
Here is how I got scanning to email via gmail to work. The existing instructions ( https://atyourservice.blogs.xerox.com/2019/09/10/gmail-and-your-xerox-multifunction-printer/ ) are sort of out of date, so this is what worked as of July 2020 ... I'm sure it will become obsolete as well eventually.
The two key differences from the instructions above are:
Firstly, it doesn't really matter what your operating system is here. Indeed, I have multiple computers and devices with various operating systems and this works for all of them.
Secondly, I'm sure there are more sophisticated ways to do this, but I've got this Workcentre 6515DP MFC for a home office setup and I don't have an IT department and a server closet with a corporate mail server and LDAP and security badges and single-signon and all that jazz. This is simple and easy to use and my kids can scan things without any problems.
This is going through the free gmail mail server that you can use with any gmail account and works if you have two factor authentication set up (which you probably should).
Create an "App password" for the printer to access gmail server (this one key thing difference from the officially published instructions, which tell you to use "Less Secure Apps")
Set up gmail itself for using the free SMTP service
Set up the time and date / time server for the printer. This is needed because SMTP mail will reject things that are not the correct time (you are only allowed to be off by +/- 3 minutes I think).
Set up the "Primary Network" and "DNS" It took some effort to figure out that I need to set primary network! This was the last thing that I finally got fixed before it started to work. This is probably different from the normal configuraiton because I have added the "WiFi" option. Also, I'm forcing the printer to use the simplest protocol -- IPV4, and also telling it exactly which DNS service to use. I haven't tested all other possible combinations, but this works and there is really no reason to use more complicated setups for me.
Set up the SMTP server to use the free gmail server.
How to use: