The JSON file re: gmailr just holds client ID and secret (which aren't really secret, btw, in this case).
Given gmail's current design, I think you must go through the interactive process once. This should cause a refresh token to be stored in .httr-oauth. And then you need to put that file in working directory for auto discovery by the script that's going to send mail for you, non-interactively.