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

Description

This function retrieves an email account's client settings.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Email/get_client_settings?account=newuser@example.com



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.
 
// Retrieve the email client settings for newuser@example.com.
$mr_mcfeeley = $cpanel->uapi(
    'Email', 'get_client_settings',
    array(
        'account'              => 'newuser@example.com'
        )
);


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.
 
# Retrieve the email client settings for newuser@example.com
my $new_email = $cpliveapi->uapi(
    'Email', 'get_client_settings',
    {
        'account'             => 'newuser@example.com'
    }
);


Note:

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

 

 cPanel Template Toolkit
<!-- Retrieve the email client settings for newuser@example.com -->
[% execute('Email', 'get_client_settings', { 'account' => 'newuser@example.com' } ) %]


Note:

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

 

 Command Line
uapi --user=username Email get_client_settings account=newuser@example.com


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. 

 Output (JSON)
{  
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{  
   "data":{  
      "smtp_username":"newuser@example.com",
      "has_plaintext_authentication":1,
      "mail_domain":"mail.example.com",
      "inbox_username":"newuser@example.com",
      "domain":"example.com",
      "inbox_service":"imap",
      "display":"newuser@example.com",
      "inbox_port":993,
      "smtp_insecure_port":"25",
      "smtp_host":"mail.example.com",
      "inbox_host":"mail.example.com",
      "inbox_insecure_port":143,
      "smtp_port":465,
      "from_archiving":0
   }
}


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
accountstring

The email account username or address for which to send client settings.

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

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

Returns

ReturnTypeDescriptionPossible valuesExample
smtp_usermamestring

The email account username or address for which to send client settings.

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

  • A valid email account username. For example, user to create user@example.com.
  • A valid email address.
newuser@example.com
has_plaintext_authenticationBooleanWhether the account supports plaintext authentication.
  • 1 — The account supports plaintext authentication.
  • 0 — The account does not support plaintext authentication.
1
mail_domainstringThe account's mail hostname.A valid hostname.mail.example.com
inbox_usernamestringThe account's username.

A valid email address.

newuser@example.com
domainstringThe account's domain name.A valid domain name.example.com
inbox_servicestringThe service type that the account uses.
  • imap
  • pop
imap
displaystringThe account's display name.A valid email address.newuser@example.com
inbox_portintegerThe account's secure inbound port.A valid positive integer.993

smtp_insecure_port

integerThe account's insecure outbound SMTP port.A valid positive integer.25
smtp_hoststringThe account's outbound SMTP hostname.A valid hostname.mail.example.com
inbox_hoststringThe account's hostname.A valid hostname.mail.example.com
inbox_insecure_portintegerThe account's insecure inbound port.A valid positive integer.143
smtp_portintegerThe account's secure outbound SMTP port.A valid positive integer.465
from_archivingBooleanWhether the account is a mail archive.
  • 1 — The account is a mail archive.
  • 0 — The account is not a mail archive.
0