Use this algorithm to send email from your Gmail account programmatically. You can pass in the credentials and the details of the message as a file to preserve privacy. Just pass in a Data file url that contains Json with the matching values for the following names:
String username, String password, String recipientEmail, String ccEmail, String title, String message
ccEmail is optional, the other fields are mandatory.