Child pages
  • cPanel API 1 Functions - Email::setmxaccept

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt

This function sets a mail exchanger's role.

Note
titleNote:

This function only affects the mail exchanger's configuration in cPanel. You must also modify the mail exchanger's DNS entry. 

Warning
titleWarning:

Include Page
LIB:_cPanelAPI1NewerFunctions
LIB:_cPanelAPI1NewerFunctions

  • UAPI (recommended)Email::set_always_accept
    Excerpt Include
    UAPI Functions - Email::set_always_accept
    UAPI Functions - Email::set_always_accept
    nopaneltrue
  • cPanel API 2Email::setalwaysaccept
    Excerpt Include
    cPanel API 2 Functions - Email::setalwaysaccept
    cPanel API 2 Functions - Email::setalwaysaccept
    nopaneltrue
Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleLiveAPI PHP Class
Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$set_mx_mxcheck = $cpanel->api1('Email', 'setmxaccept', array('example.com', 'local') ); // Call the function.

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

Expand
titleLiveAPI Perl Module
Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $set_mx_mxcheck = $cpliveapi->api1('Email', 'setmxaccept', ['example.com', 'local'] ); # Call the function.

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 

Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelTagsWarning
LIB:_cPanelTagsWarning

Code Block
languagetext
<cpanel Module="Email::setmxaccept( $FORM('domain','mxcheck') )">
Expand
titleCommand Line
Code Block
cpapi1 --user=username Email setmxaccept example.com local

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote

Expand
titleOutput (none)

This function does not return output.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain name.

A valid domain on the server.

example.com
mxcheckstring

Required

The mail exchanger's role.

  • auto — Use a DNS query to determine the appropriate role.
  • local — Always accept and route mail.
  • secondary — Accept mail if a higher-priority mail server is not available.
  • remote — Never accept mail for the domain.
local

Returns

This function does not return output.