将数据保存到联机文本文档


Saving data to online text document

我有一个问题,我想将数据保存到谷歌云端硬盘上的在线共享文本文档中。但它不起作用。没有错误,它只是没有将任何内容保存到文档中,我已经为文档提供了公众的完全访问权限。

////// email code
        require_once "Mail.php";    
        $from = "Babylovenappies <****@gmail.com>";
        $to = "nassim@*****.com";
        $recipients = $to;
        $subject = $subject;
        $body = $message;
        $host = "ssl://smtp.googlemail.com";
        $port = "465";
        $username = "****@gmail.com";
        $password = "****";
        $headers = array ('From' => $from,
        'To' => $to,
        'Bcc' => "admin@***.com.au",
        'Subject' => $subject,
        'MIME-Version' => "1.0",
        'Content-type' => "text/html; charset=iso-8859-1");
        $smtp = Mail::factory('smtp',
        array ('host' => $host,
        'port' => $port,
        'auth' => true,
        'username' => $username,
        'password' => $password));
        $mail = $smtp->send($recipients, $headers, $body);

        $fh = fopen('https://docs.google.com/document/d/1dS_MhqGnLkb22mwU6OKfxoiFcX0izRTvjjf8eJ7igiE/edit?usp=sharing', "a");
        fwrite($fh, $to);
        fclose($fh);

提前致谢

你绝对应该使用 API

看看这个:文件:更新