send email using gmail-api and google-api-php-client
I am using https://github.com/google/google-api-php-client and I want to send a test email with a user's authorized gmail account. This is what I have so far: $msg = new Google_Service_Gmail_Message(); $msg->setRaw('gp1'); $service->users_messages->send('me', $msg); This results in a bounce email because I have no clue how to set the raw message. I see the bounce in the inbox of my authenticated user. I want to learn how to set values for 'To', 'Cc', 'Bcc', 'Subject', and 'Body' of the email. I believe I will need to do a 64 encoding on that raw data as well. And I might want to use some html