Jump to content

Recommended Posts

HTML cannot send emails, but a server-side programming language can. PHP is one of the easiest to learn.

You can learn how to send mail from PHP here: https://www.w3schools.com/php/func_mail_mail.asp

You can learn how to gather form data from an HTML page here: https://www.w3schools.com/php/php_forms.asp

Link to post
Share on other sites

Create email accounts? That is pretty complicated, I'm afraid I wouldn't know where to begin with that.

Link to post
Share on other sites

<?php

class Cpanel {

    static public function action($params = array()){

        $cpuser      = (isset($params['cpuser']))      ? $params['cpuser']       : '';//cpanel username
        $cppass      = (isset($params['cppass']))      ? $params['cppass']       : '';//cpanel password
        $cpdomain    = (isset($params['cpdomain']))    ? $params['cpdomain']     : '';//cpanel domain address (domain.com)
        $cpskin      = (isset($params['cpskin']))      ? $params['cpskin']       : 'x3';//cpanel theme
        $emailname   = (isset($params['emailname']))   ? $params['emailname']    : '';//email name before @
        $emaildomain = (isset($params['emaildomain'])) ? $params['emaildomain']  : '';//email domain address (domain.com)
        $emailpass   = (isset($params['emailpass']))   ? $params['emailpass']    : '';//email password
        $quota       = (isset($params['quota']))       ? $params['quota']        : '250';//quote 0 for unlimited MB
        $action      = (isset($params['action']))      ? $params['action']       : '';//action to perform

        switch ($action) {
            case 'createemail':
                fopen("https://$cpuser:$cppass@$cpdomain:2083/frontend/$cpskin/mail/doaddpop.html?email=$emailname&domain=$emaildomain&password=$emailpass&quota=$quota", "r");
                break;
            case 'deleteemail':
                fopen("https://$cpuser:$cppass@$cpdomain:2083/frontend/$cpskin/mail/realdelpop.html?email=$emailname&domain=$emaildomain", "r");
                break;
        }

        
    }

}

require('cpanel.php');

Cpanel::action(array('emailname' => 'demo466', 'emailpass' => 'helllo123', 'action' => 'createemail'));

Cpanel::action(array('emailname' => 'demo466', 'action' => 'deleteemail'));


$params = array(
    'emailname' => 'demo466', 
    'emailpass' => 'helllo123', 
    'action' => 'createemail'
)
Cpanel::action($params);


$params = array(
    'cpuser' => 'cpanelusername', 
    'cppass' => 'cpanelpassword', 
    'cpdomain' => 'domain.com', 
    'cpskin' => 'x3', 
    'emailname' => 'demo466', 
    'emailpass' => 'helllo123', 
    'emaildomain' => 'domain.com', 
    'quota' => '500',  
    'action' => 'createemail'
)
Cpanel::action($params);

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...