简体   繁体   English

PHP 中具有 gmail API 的用户的别名列表

[英]List of aliases of an user with gmail API in PHP

I try to find all aliases from an user with the gmail API with PHP:我尝试使用 gmail API 和 PHP 的用户查找所有别名:

function recupererAlias($user)
{
   $gmail = objetGmailAPI($user);
    try
    {
       $req = $gmail->users_settings_sendAs->list($user);
       return $req;
    } catch (exception $e) {
        return 'Error<hr/>'.$e;
    }
}

The error is:错误是:

Call to undefined method Google_Service_Gmail_Resource_UsersSettingsSendAs::list(调用未定义的方法 Google_Service_Gmail_Resource_UsersSettingsSendAs::list(

Why?为什么?

The correct syntax is:正确的语法是:

function recupererAlias($user)
{
   $gmail = objetGmailAPI($user);
    try
    {
       $req = $gmail->users_settings_sendAs-> listUsersSettingsSendAs($user);
       return $req;
    } catch (exception $e) {
        return 'Error<hr/>'.$e;
    }
}

Thank you to El_Vanja for the help, I see the documentation like his advice.感谢 El_Vanja 的帮助,我看到的文档就像他的建议一样。 Thanks again:)再次感谢:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM