UAPI Functions - Email::add_pop

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

 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',
        )
);

 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',
    }
);

 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' } ) %]

 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.

 Output (JSON)

   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{ 
 
   },
   "data":"user+example.com"
}

 

Note:

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

 

Parameters

Parameter

Type

Description

Possible values

Example

email

string

Required

The email account username or address.

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

user

password

string

Required

The email account password.

A secure password.

12345luggage

domain

string

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 createuser@example.com.

example.com

quota

integer

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_db 

 Boolean 

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_hash

string

The account's password hash.

Note:

 

  • You can use this parameter in place of the password parameter. However, you cannot use bothpassword and password_hashparameters in the same request.
  • This parameter is only available in cPanel and WHM version 54+.

 

 

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

Note:

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

 

 

Returns

 Return 

Type

Description

Possible values

Example

data

 string 

The email address.

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

 user+example.com 

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....