定制 akashrajput9/php-cpanel-email-master 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

akashrajput9/php-cpanel-email-master

Composer 安装命令:

composer require akashrajput9/php-cpanel-email-master

包简介

This package will help to fetch emails from cPanel or create emails to cPanel

README 文档

README

A php laravel package to manage cPanel email accounts

  • Get a list of all email accounts.
  • Create a new email account.
  • Delete an email account.
  • Change an email account's password.
  • Change an email account's disk quota.

Installation

composer require naif/php-cpanel-email

If your Laravel below 5.5 you need to add service provider and alias to config/app.php

Under Providers:
\Naif\cPanelMail\cPanelServiceProvider::class,

Under aliases:
'cPanel' => \Naif\cPanelMail\Facades\cPanelMail::class,

Add these to your .env

CPANEL_DOMAIN=your_domain.com
CPANEL_HOST=https://your_domain.com
CPANEL_PORT=2083 // cPanel port Default is: 2083
CPANEL_VERSION=2 // cPanel api current version
CPANEL_USERNAME=your_cpanel_username
CPANEL_PASSWORD=your_cpanel_password

Usage

Create a class object

$cpanel = new cPanel()

Get a list of all email addresses

$cpanel->getEmailAddresses()

Response:
array:5 [
  0 => Email {#227 ▼
    +user: "abc"
    +domain: "domain.com"
    +email: "abc@domain.com"
    +_diskused: 0
    +_diskquota: 0
    +humandiskused: "None"
    +humandiskquota: "None"
    +suspended_incoming: 0
    +suspended_login: 0
    +mtime: 1539715896
   }
 ]

Create a new email account

$cpanel->create('username','password')

Response:
[
  "status" => "success"
  "message" => "Email address has been added successfully"
]

Delete an email account

$cpanel->delete('email_address')

Response:
[
  "status" => "success"
  "message" => "Email address has been deleted successfully"
]

Change an email account's password

$cpanel->changePassword('username','password')

Response:
[
  "status" => "success"
  "message" => "Password has been changed successfully"
]

Change an email account's disk quota

$cpanel->changeQuota('username',500)//quota as a number or 0 to set it as unlimited

Response:
[
  "status" => "success"
  "message" => "Email disk quota has been changed successfully"
]

Support:

naif@naif.io

https://www.linkedin.com/in/naif

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-02-08