Hi Grant,
I am the creator of that project. I think the reason why you don’t have a refresh_token is because you haven’t gone through the browser login process to get a refresh_token and if you have… you haven’t saved it.
I also note from the code above you have the following code - which is not the correct way. The username and password are entered in the web browser.
I designed the project so that you could just add the EmailOAuthDm.pas datamodule into your project, create the datamodule object and use the functions in that file.
I recently updated the project as well to make it support TLS 1.3 with TaurusTLS and added a function that can send HTML email messages with inline images and attachments.