API Edit Email Config

From Virtualizor Wiki
Jump to: navigation, search
NOTE
This is OLD API Documentation. Click on the following link for New API Documentation
Admin API

Edit Email Configuration

Parameters Description
mail 1 for PHP Mail, 0 for SMTP
mail_server SMTP Server
mail_port SMTP Port
mail_user SMTP Username
mail_pass SMTP Password

Example Code

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

    $ip = 'xxx.xxx.xxx.xxx';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $post = array();
    $post['mail']        = '1';
    $post['mail_server'] = '';
    $post['mail_port']   = '';
    $post['mail_user']   = '';
    $post['mail_pass']   = '';

    $output = $admin->emailconfig($post)
    print_r($output);
?>

Returns:

Array
(
    [title] => Email Settings
    [done] => 1
    [timenow] => 1403162981
    [time_taken] => 0.017
)