将数据保存到在线文本文档

时间:2013-10-18 10:49:43

标签: php

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

////// 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);

提前致谢

1 个答案:

答案 0 :(得分:0)

你绝对应该使用API​​

看看这个: Files: update