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

Check out our new API beta site!

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

Description

This function retrieves autoresponder information.

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_auto_responder?email=user%40example.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 autoresponder for user@example.com
$get_auto_responder = $cpanel->uapi(
    'Email', 'get_auto_responder',
    array(
        'email'         => 'user@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 autoresponder for user@example.com
my $get_auto_responder = $cpliveapi->uapi(
    'Email', 'get_auto_responder',
    {
        'email'         => 'user@example.com',
    }
);


Note:

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


 Command Line
uapi --user=username Email get_auto_responder email=user%40example.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,
  "data": {
    "stop": 1410300000,
    "subject": "Autoresponder Subject",
    "charset": "utf-8",
    "interval": 24,
    "body": "This is an autoresponder message.",
    "from": "User Name",
    "is_html": 0,
    "start": 1410277881
  }
}


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 name.

A valid email account name on the server.

For example, user if the email address is user@example.com .

user
temp_charsetstring

The autoresponder's character set.

This parameter defaults to utf-8 .

Any standard character encoding set.

utf-8

Returns

ReturnTypeDescriptionPossible valuesExample
fromstring

The contents of the autoresponder message's From: field.

Any string, or a blank value.

User Name
subjectstring

The contents of the autoresponder message's Subject: field.

Any string, or a blank value.Autoresponder Subject
bodystring

The contents of the autoresponder message's Body section.

Any string, or a blank value.This is an autoresponder message.
is_htmlBoolean

Whether the body of the autoresponder message begins with an HTML content type declaration.

  • 1 — Includes an HTML content type declaration.
  • 0 — Does not include an HTML content type declaration.
1
charsetstring

The autoresponder's character set.

Any standard character encoding set.

UTF-8
intervalinteger

The amount of time, in hours, that the server waits between autoresponder messages to the same address.

Any positive integer.

Note:

A value of 0 indicates that the system sends a message for each email received. 

24
startinteger

When the autoresponder becomes enabled in Unix time.

A time, in Unix time format. 1410277881
stopinteger

When the autoresponder becomes disabled in Unix time.

A time that is after the start time, in Unix time format.1410300000