Get emails text from specific sender

i wnated to use autohotkey to receive or check my inbox for a specific sender and get the email text after
i searched and there is imap but i don’t know anything about how to use it
can anyone help me?
its important for me that the method can be used with command base controls that the thing goes in the background and i want it to be free for changing the email or email server or… each time i get a new code.