有人可以教我如何进行简单的文件上传,然后使用和Gmail api php在codeigniter中发送,感谢提前到目前为止我有这个
$user = 'me';
$strRawMessage = "To: $sendTo \r\n";
$strRawMessage .= "MIME-Version: 1.0\r\n";
$strRawMessage .= "Content-Type: text/html; charset=utf-8\r\n";
$strRawMessage .= 'Content-Transfer-Encoding: quoted-printable' . "\r\n\r\n";
$strRawMessage .= " $message \r\n";
$strRawMessage .= " Content-Type: image/jpeg\r\n";
$strRawMessage .= "MIME-Version: 1.0\r\n";
$strRawMessage .= 'Content-Transfer-Encoding: base64' . "\r\n\r\n";
$strRawMessage .= "Content-Disposition: attachment; filename='test.jpg'\r\n";
// The message needs to be encoded in Base64URL
$mime = rtrim(strtr(base64_encode($strRawMessage), '+/', '-_'), '=');
$msg = new Google_Service_Gmail_Message();
$msg->setRaw($mime);
// $service->users_messages->send("me", $msg);