You can find our user documentation at docs.cpanel.net.

Check out our new API beta site!

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.

Important:

In cPanel & WHM version 76 and later, when you disable the Receive Mail role, the system disables this function.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Email/get_client_settings?account=username@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 username@example.com.
$mr_mcfeeley = $cpanel->uapi(
    'Email', 'get_client_settings',
    array(
        'account'              => 'username@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 username@example.com
my $new_email = $cpliveapi->uapi(
    'Email', 'get_client_settings',
    {
        'account'             => 'username@example.com'
    }
);


Note:

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


 Command Line
uapi --user=username Email get_client_settings account=username@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. 
  • 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": {
			"account": "username@example.com",
			"smtp_username": "username@example.com",
			"has_plaintext_authentication": 1,
			"mail_domain": "mail.example.com",
			"inbox_username": "username@example.com",
			"domain": "example.com",
			"inbox_service": "imap",
			"display": "username@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 address for which to send client settings.

This parameter defaults to the system default email account.

A valid email address.

username@example.com

Returns

ReturnTypeDescriptionPossible valuesExample
accountstringThe account's email address.
  • The system default email account.
  • A valid email address.
username@example.com
smtp_usernamestring

The account's SMTP username.

  • The system default email account.
  • A valid email address.
username@example.com
has_plaintext_authenticationBooleanWhether the account supports plaintext authentication.
  • 1 — Supported.
  • 0Not supported.
1
mail_domainstringThe account's mail hostname.A valid hostname.mail.example.com
inbox_usernamestringThe account's username.
  • The system default email account.
  • A valid email address.
username@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.
  • The system default email account's main domain.
  • A valid email address.
username@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