using Gmail API with PHP and curl, I have that :
$message = "To: hisemail@domain.com\r\nFrom: myemail@domain.com\r\nSubject: thesubject\r\n The message";
$ch = curl_init('https://www.googleapis.com/upload/gmail/v1/users/me/messages/send');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Authorization: Bearer ".$access_token,
'Accept: application/json',
'Content-Type: message/rfc822'
));
curl_setopt($ch, CURLOPT_POSTFIELDS, $message);
$data = curl_exec($ch);
curl_close($ch);
It is working very well, the email arrives with the subject. BUT only the subject, not the content ("The message"). Does someone know where the content is gone ? How could I do not changing all that script ? Thank you very much