Child pages
  • UAPI Functions - Email::add_pop

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt
This function creates an email address.
multiexcerpt-include


PageWithExcerptLIB:_ServerRoleDisabledAPI
Warning
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665MultiExcerptNameAPIDisabledReceiveMailRole
titleImportant:


Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titlecPanel or Webmail Session URL


Code Block
languagetext
https://hostname.example.com:2083/cpsess##########/execute/Email/add_pop?email=user&password=12345luggage&quota=0&domain=example.com&skip_update_db=1


Include Page
LIB:_CallUAPIFromBrowserLink
LIB:_CallUAPIFromBrowserLink


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$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',
        )
);

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink
 


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
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',
    }
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink


Expand
titlecPanel Template Toolkit


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

Include Page
LIB:_TTLink
LIB:_TTLink


Expand
titleCommand Line


Code Block
languagebash
uapi --user=username Email add_pop email=user password=12345luggage quota=0 domain=example.com skip_update_db=1

Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{  
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{  

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


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
emailstring

Required

The email account username or address.

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

    Note
    titleNote:

    In cPanel & WHM version 78 and later, you cannot enter cpanel as an account name when you create an email account.


  • 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
titleNote:

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
    titleNote:

    This value cannot exceed the maximum email quota.


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

    Note
    titleNote:

    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.

Note
titleNotes:
  • 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
titleNote:

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



Expand
titleClick to view...

$6$1sOyHP5ZDYp3pGUz$R0TSgfPRHfDjT5PP5RJGv39FhiGTNNPvM7IFpCBjXijMmlMZk9yI8T3LqGuntc9fdKb5eX.lGL7wBS9e4DAWn/


send_welcome_emailBoolean

Whether to send client configuration instructions to the account.

Note
titleNote:

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