It is very easy.
First, You need to have IMAP active. It is activated by default. However, if you use multi-factor authentication on your account, you will need to create special passwords for Sam.
See this explanation from microsoft read here..
Most of the time, simply configure Sam9000-APM directly.
Alternative for Google Gmail account.
Edit Settings in Sam9000 - APM
Then Use the following values :
Once all setup, change the status of the email account by clicking the Activate Button.
If all your parameters are correct, the account should go green and say ON.