Description

This function sets a mail exchanger's role.

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

Examples 


$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$set_mx_mxcheck = $cpanel->api1('Email', 'setmxaccept', array('example.com', 'local') ); // Call the function.

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.

 

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

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.