UAPI Functions - Email::add_auto_responder

Description

This function creates an autoresponder for an email account.

Examples


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Email/add_auto_responder?email=user&from=User%20Name&subject=Autoresponder%20Subject&body=This%20is%20an%20autoresponder%20message.&domain=example.com&is_html=1&interval=24&start=1410277881&stop=1410300000

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// Create an autoresponder for user@example.com
$add_auto_responder $cpanel->uapi(
    'Email''add_auto_responder',
    array(
        'email'         => 'user',
        'from'          => 'User Name',
        'subject'       => 'Autoresponder Subject',
        'body'          => 'This is an autoresponder message.',
        'domain'        => 'example.com',
        'is_html'       => '1',
        'interval'      => '24',
        'start'         => '1410277881',
        'stop'          => '1410300000',
         )
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# Create an autoresponder for user@example.com
my $add_auto_responder $cpliveapi->uapi(
    'Email''add_auto_responder',
    {
        'email'         => 'user',
        'from'          => 'User Name',
        'subject'       => 'Autoresponder Subject',
        'body'          => 'This is an autoresponder message.',
        'domain'        => 'example.com',
        'is_html'       => '1',
        'interval'      => '24',
        'start'         => '1410277881',
        'stop'          => '1410300000',
    }
);

 cPanel Template Toolkit

<!-- Create an autoresponder for user@example.com -->
[% data = execute( 'Email', 'add_auto_responder', { 'email' => 'user', 'from' => 'User Name', 'subject' => 'Autoresponder Subject', 'body'          => 'This is an autoresponder message.', 'domain' => 'example.com', 'is_html' => '1', 'interval' => '24', 'start' => '1410277881', 'stop' => '1410300000' } ); %]

 Command Line

uapi --user=username Email add_auto_responder email=user from="User Name" subject="Autoresponder Subject" body="This is an autoresponder message." domain=example.com is_html=1 interval=24 start=1410277881 stop=1410300000

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
      
  },
  "data": null
}

 

Note:

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

 

Parameters

 Parameter 

Type

Description

Possible values

Example

email

string

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

from

string

Required

The contents of the autoresponder message'sFrom: field.

Any string, or a blank value.

User Name

subject

string

Required

The contents of the autoresponder message'sSubject: field.

Any string, or a blank value.

Autoresponder Subject

body

string

Required

The contents of the autoresponder message'sBody section.

Any string, or a blank value.

 This is an autoresponder message. 

domain

string

Required

The email account's domain.

The email account's domain.

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

example.com

is_html

Boolean

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

charset

string

The character set.

This parameter defaults to us-ascii.

Any standard character encoding set.

UTF-8

interval

integer

Required

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

Any positive integer.

Note:

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

24

start

integer

Required

When to disable the autoresponder in Unix time.

A time, in Unix time format.

1410277881

stop

integer

Required

When to disable the autoresponder in Unix time.

A time that is after the start time, inUnix time format.

1410300000

 

Returns

This function only returns metadata.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....