PHP code example of feehi / exmail
1. Go to this page and download the library: Download feehi/exmail library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
feehi / exmail example snippets
//出现ip_freq_block错误,请到腾讯企业邮箱web管理页面:可使用此开放接口的IP,添加/修改当前服务器的ip
$exmail->access_token)."\r\n\r\n";//获取Access Token
print_r( $exmail->getAutoLoginUrl('[email protected] ') )."\r\n\r\n";//获取[email protected] 自动登录的链接
print_r( $exmail->listen(1) )."\r\n\r\n";//客户端维持长连接,传入的值为本地维护的最新版本号
print_r( $exmail->getUser("[email protected] ") )."\r\n\r\n";//获取[email protected] 个人资料
print_r( $exmail->sync(2, '[email protected] ', 'demo_new_user', 1, 'programmer', '0755-123456', '13888888', '10', 'PASSword123456', 0) )."\r\n\r\n";//同步成员账号资料,第一个参数:1删除,2新增,3修改
print_r( $exmail->getUpdateInfoByVer(1) )."\r\n\r\n";//获取某个版本号后的用户更新情况
print_r( $exmail->getUnreadMailCount('[email protected] ') )."\r\n\r\n";//获取[email protected] 未读邮件数量
print_r( $exmail->partySync(2, 'newParty') )."\r\n\r\n";//同步部门,第一个参数:1=删除, 2=新增, 3=修改
print_r( $exmail->getPartyList("/") )."\r\n\r\n";//获取某个部门子部门
print_r( $exmail->getUserListByParty("/") )."\r\n\r\n";//获取某部门下的成员邮箱账号
print_r( $exmail->checkUsernameAvailable("[email protected] ") )."\r\n\r\n";//检查邮箱账号[email protected] 是否被注册,需要检查多个邮箱,传入数组,如:['[email protected] ', '[email protected] ']
print_r( $exmail->groupAdd("sales_party", "[email protected] ", "all", ["[email protected] ", "[email protected] "]) )."\r\n\r\n";//新建邮件群组,群组名称sales_party,群组邮箱号[email protected] ,群组权限all代表所有成员都可以群发邮件,还有inner,group,list可选,群组成员[email protected] , [email protected]
//print_r( $exmail->groupDelete("[email protected] ") )."\r\n\r\n";//删除邮件群组[email protected]
print_r( $exmail->groupAddMember("[email protected] ", ['[email protected] ', '[email protected] ']) )."\r\n\r\n";//增加邮件群组成员,把demo1和demo2加入sales邮件群组
//print_r( $exmail->groupDeleteMember("[email protected] ", ['[email protected] ', '[email protected] ']) )."\r\n\r\n";//删除邮件群组成员,把demo1和demo2移出sales邮件群组
print_r( $exmail->groupAddPermission("[email protected] ", ['[email protected] ', '[email protected] ']) )."\r\n\r\n";//添加邮件群组群发权限,添加[email protected] 群组下的demo1和demo2允许群发邮件
print_r( $exmail->groupDeletePermission("[email protected] ", ["[email protected] ", "[email protected] "]) )."\r\n\r\n";//取消群发群组权限,取消demo1和demo2在sales群组下的群发邮件权限
print_r( $exmail->enableForceWeChatToken("[email protected] ") )."\r\n\r\n";//强制开启[email protected] 登录需要微信验证
print_r( $exmail->disForceWeChatToken("[email protected] ") )."\r\n\r\n";//取消强制[email protected] 登录需要微信验证
bash
$ php composer.phar update