Child pages
  • cPanel API 1 Functions - Email::addautoresponder
Skip to end of metadata
Go to start of metadata

Description

This function creates an autoresponder for an email account.

Note:

This function is not available in demo mode.

Warning:

cPanel API 1 is deprecated. Do not use this function. Instead, we strongly recommend that you use the following newer functions:

Examples 


 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$add_autoresponder = $cpanel->api1('Email', 'addautoresponder', array('user', 'User Name', 'Autoresponder Subject', 'This is an autoresponder message.', 'example.com', '1', 'UTF-8', '24', '1410277881', '1410300000') ); // Call the function.


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.
my $add_autoresponder = $cpliveapi->api1('Email', 'addautoresponder', ['user', 'User Name', 'Autoresponder Subject', 'This is an autoresponder message.', 'example.com', '1', 'UTF-8', '24', '1410277881', '1410300000'] ); # Call the function.


Note:

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

 

 cPanel Tag System (deprecated)


Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="Email::addautoresponder( $FORM('email','from','subject','body','domain','html','charset','interval','start','stop') )">
 Command Line
cpapi1 --user=username Email addautoresonder user Username "Autoresponder Subject" "This is an autoresponder message." example.com 1 UTF-8 24 1410277881 1410300000


Notes:

  • You must URI-encode these values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the cpapi1 command:

    /usr/local/cpanel/bin/cpapi1

 Output (none)

This function does not return output.

Parameters

ParameterTypeDescriptionPossible valuesExample
emailstring

Required

The email account name.

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

A valid email account name on the server.

user
fromstring

Required

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

Any string, or a blank value.

User Name
subjectstring

Required

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

Any string, or a blank value.Autoresponder Subject
bodystring

Required

The contents of the autoresponder message's Body section.

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

Required

The email account's domain.

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

The email account's domain.example.com
htmlBoolean

Required

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

  • 1 — Include an HTML content type declaration.
  • 0 — Do not include an HTML content type declaration.
1
charsetstring

The character set to use.

This parameter defaults to us-ascii.

Any standard character encoding set.

UTF-8
intervalinteger

Required

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

An integer value.

Note:

If you specify 0, the system sends a message for each email received. 

24
startinteger

Required

The time at which to enable the autoresponder.

A time, in Unix time format. 1410277881
stopinteger

Required

The time at which to disable the autoresponder.

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

Returns

This function does not return output.