Child pages
  • UAPI Functions - Email::add_pop
Skip to end of metadata
Go to start of metadata

Description

This function creates an email address.

Important:

In cPanel & WHM version 76 and later, when you disable the MailReceive role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Email/add_pop?email=user&password=12345luggage&quota=0&domain=example.com&skip_update_db=1



Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Create the user@example.com email address.
$new_email = $cpanel->uapi(
    'Email', 'add_pop',
    array(
        'email'           => 'user',
        'password'        => '12345luggage',
        'quota'           => '0',
        'domain'          => 'example.com',
        'skip_update_db'  => '1',
        )
);


Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Create the user@example.com email address.
my $new_email = $cpliveapi->uapi(
    'Email', 'add_pop',
    {
        'email'           => 'user',
        'password'        => '12345luggage',
        'quota'           => '0',
        'domain'          => 'example.com',
        'skip_update_db'  => '1',
    }
);


Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Template Toolkit
<!-- Create the user@example.com email address. -->
[% execute('Email', 'add_pop', { 'email' => 'user', 'password' => '12345luggage', 'quota' => '0', 'domain' => 'example.com', 'skip_update_db' => '1' } ) %]


Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username Email add_pop email=user password=12345luggage quota=0 domain=example.com skip_update_db=1


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{  
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{  

   },
   "data":"user+example.com"
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
emailstring

Required

The email account username or address.

  • A valid email account username. For example, user to create user@example.com.
  • A valid email address.
user
passwordstring

Required

The email account password.

A secure password.

12345luggage
domainstring

The email account's domain.

This parameter defaults to the cPanel account's main domain.

A valid domain on the cPanel account.

For example, example.com to create user@example.com.

example.com
quotainteger

The maximum amount of disk space that the new email account may use.

Note:

We introduced this functionality in cPanel & WHM version 70.

This parameter defaults to the defined system value.

  • A positive integer that represents the maximum amount of disk space, in Megabytes (MB).

    Note:

    This value cannot that exceeds the maximum email quota.

  • 0 or unlimited — The account possesses unlimited disk space.

    Note:

    This value is only available to users without a maximum email account quota.

500
skip_update_dbBoolean

Whether to skip the update of the email accounts database's cache.

This parameter defaults to 0.

  • 1 — Skip the update.
  • 0 — Perform the update.
1
password_hashstring

The account's password hash.

Notes:

  • You can use this parameter instead of the password parameter. However, you cannot use both password and password_hash parameters in the same request.
  • We introduced this parameter in cPanel & WHM version 54+.

A valid password hash that uses your server's cryptographic hash function.

Note:

You can find your server's hash type in the /etc/sysconfig/authconfig file.

 Click to view...

$6$1sOyHP5ZDYp3pGUz$R0TSgfPRHfDjT5PP5RJGv39FhiGTNNPvM7IFpCBjXijMmlMZk9yI8T3LqGuntc9fdKb5eX.lGL7wBS9e4DAWn/

send_welcome_emailBoolean

Whether to send client configuration instructions to the account.

Note:

We introduced this parameter in cPanel & WHM version 62.

This parameter defaults to 0 .

  • 1 — Send the instructions.
  • 0 — Do not send the instructions.
0

Returns

ReturnTypeDescriptionPossible valuesExample
datastringThe email address.

The email account username, a plus character (+), and the email account domain.

user+example.com