After getting your SSL certificate signed by an authority, you may go to Webmin -> Webmin Configuration -> SSL Encryption to enable SSL mode.

The key fields are Private key file, Certificate file and Additional certificate files (for chained certificates).
Possible issue:
In my case, I just copied the private.key content into /etc/webmin/miniserv.pem but it wasn't that simple. The private.key file was generated by openssl and had the following format:

Once I hit save button, webmin failed to restart with the following error in the log (/var/webmin/miniserv.error)

Failed to open SSL key /etc/webmin/miniserv.pem at /usr/libexec/webmin/miniserv.pl line 4332.
Error: Webmin server did not write new PID file

It took me a little while to realise that webmin couldn't interpret the file due to ENCRYPTED bit indicating it isn't a PEM format.
Solution:
After googling how to convert private key to PEM format, I came up with this.

Assuming restarting webmin will be all it takes but another problem occurred. Webmin relies on perl and particularly perl-Net-SSLeay module to read SSL encrypted files. However, my key has a passphrase which Webmin requires perl-PAM module to read. So bellow is the result of another google search.

This means that in its simplest form, we need only specify the recipient, the subject, and the message. We can also specify extra parameters (for example, the from address).

You’ll notice from the return type of the function that a Boolean is returned upon completion. If PHPsuccessfully passed the email to the SMTP server then true is returned. If an error occurred then false is returned. Please note that even if true is returned the mail may not be sent! (For example if the SMTP is incorrectly configured. In this case you should consult your SMTP server logs to see what went wrong).

To send the email from the previous section – with error checking – we use the following code:

It is also possible to send an email to multiple recipients with a single call to the mail() function. Here is an example. All you need to do is modify the recipient variable as follows:

<?php
$to = "johndoe@fakedomain.com, somebodyelse@fakedomain.com";
?>

Sending HTML emails in PHP

There is no real trick to sending HTML formatted email. After all, it’s only text – just as normal emailmessages are. The difference is in how email clients interpret that text.

The main step involved is in telling the email client that the email is HTML and not plain text. To do this we simply add the Content-type header. HTML uses the text/html mime type. Plain text emails use text/plain.

In the previous two chapters I showed how to send plaintext and HTML emails. The main limitation with doing HTML as I showed in the previous chapter is that in an email client that doesn’t support HTML email, the user sees a bunch of HTML tags.

The solution to this is to send a multi-part email. That is, within the one message, send a plaintext version and a HTML version. Unfortunately this is complicated with the mail() function as-is.

In order to get around this, we use the Mail_Mime class from the Pear repository. This also allows us to send attachments with our email.

In the following example, we use the Mail_Mime class to send an email with both plain text and HTML, as well as an attachment. Comments are included in the code to explain what is happening.

<?php
require_once('Mail.php'); // These two files are part of Pear,
require_once('Mail/Mime.php'); // and are required for the Mail_Mime class
$to = "johndoe@fakedomain.com";
// the email address of the person receiving the email
$from = "janedoe@anotherfakedomain.com";
// the email address of the sender
$subject = "This is a test email";
// the subject of the email
$attachment = "/path/to/someFile.pdf";
// the path to the file we are attaching to the email
// Next we must build an array of email headers for the email.
// This is structured slightly differently to the mail() function.
// The array key is the header name. Remember that subject
// is a header too!
$headers = array('From' => $from,
'Subject' => $subject);
// Here we create the plaintext version of the email to be sent
$textMessage = "Dear John,\n\nThis is a fake email, I hope you enjoy it.\n\nFrom Jane.";
// Here we create the HTML version of the email to be send, using
// the heredoc syntax
$htmlMessage = <<<EOF
<strong>Hello World!</strong>
EOF;
$mime = new Mail_Mime();
// create a new instance of the Mail_Mime class
$mime->setTxtBody($textMessage);
// set our plaintext message
$mime->setHtmlBody($htmlMessage);
// set our HTML message
$mime->addAttachment($attachment);
// attach the file to the email
$body = $mime->get();
// This builds the email message and returns it to $body.
// This should only be called after all the text, html and
// attachments are set.
$hdrs = $mime->headers($headers);
// This builds the corresponding headers for the plaintext,
// HTML and any other required headers. It also includes
// the headers we created earlier by passing them as an argument.
$mail = &Mail::factory('mail');
// Creates an instance of the mail backend that we can use
// to send the email.
$mail->send($to, $hdrs, $body);
// Send our email, according to the address in $to, the email
// headers in $hdrs, and the message body in $body.
?>