Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function creates an email address.

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. 
  • We introduced this functionality in cPanel & WHM version 56.

 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.

This parameter defaults to 250.

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

Note:

To grant unlimited disk space, specify 0.

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.

Note:

  • You can use this parameter in place 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/

Returns

ReturnTypeDescriptionPossible valuesExample
datastringThe email address.

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

user+example.com